| @@ -1,57 +1,69 @@ | ||
| 1 | +<?php | |
| 2 | +if (!defined('ABSPATH') && !defined('BITFORMS_ASSET_URI')) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +?> | |
| 6 | + | |
| 1 | 7 | <!DOCTYPE html> |
| 2 | 8 | <html lang="en"> |
| 9 | + | |
| 3 | 10 | <head> |
| 4 | 11 | <meta charset="UTF-8"> |
| 5 | 12 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | - <title><?= isset($title) ? $title : 'Conversational Form'; ?></title> | |
| 13 | + <title><?php echo isset($title) ? esc_html($title) : 'Conversational Form'; ?></title> | |
| 7 | 14 | <style> |
| 8 | - * { | |
| 9 | - padding: 0; | |
| 10 | - margin: 0; | |
| 11 | - box-sizing: border-box; | |
| 12 | - } | |
| 15 | + * { | |
| 16 | + padding: 0; | |
| 17 | + margin: 0; | |
| 18 | + box-sizing: border-box; | |
| 19 | + } | |
| 13 | 20 | |
| 14 | - body.bit-conversational-form { | |
| 15 | - height: 100vh; | |
| 16 | - overflow: hidden; | |
| 17 | - } | |
| 21 | + body.bit-conversational-form { | |
| 22 | + height: 100vh; | |
| 23 | + overflow: hidden; | |
| 24 | + } | |
| 18 | 25 | |
| 19 | - @media (max-width: 575.98px) { | |
| 20 | - .standalone-form-wrapper { | |
| 21 | - width: 100%; | |
| 22 | - } | |
| 26 | + @media (max-width: 575.98px) { | |
| 27 | + .standalone-form-wrapper { | |
| 28 | + width: 100%; | |
| 23 | 29 | } |
| 24 | - | |
| 30 | + } | |
| 25 | 31 | </style> |
| 26 | 32 | <?php |
| 27 | 33 | $baseCSSPath = "/form-styles/bitform-{$formID}.css"; |
| 28 | - $baseConversationalCSSPath = "/form-styles/bitform-conversational-{$formID}.css"; | |
| 29 | - $customCSSPath = "/form-styles/bitform-custom-{$formID}.css"; | |
| 30 | - $standaloneCSSPath = "/form-styles/bitform-standalone-{$formID}.css"; | |
| 31 | - ?> | |
| 32 | - <link rel="stylesheet" href="<?= BITFORMS_UPLOAD_BASE_URL . $baseCSSPath ?>" /> | |
| 33 | - <link rel="stylesheet" href="<?= BITFORMS_UPLOAD_BASE_URL . $baseConversationalCSSPath ?>" /> | |
| 34 | - | |
| 34 | +$baseConversationalCSSPath = "/form-styles/bitform-conversational-{$formID}.css"; | |
| 35 | +$customCSSPath = "/form-styles/bitform-custom-{$formID}.css"; | |
| 36 | +$standaloneCSSPath = "/form-styles/bitform-standalone-{$formID}.css"; | |
| 37 | +?> | |
| 38 | + <link rel="stylesheet" href="<?php echo esc_url(BITFORMS_UPLOAD_BASE_URL . $baseCSSPath) ?>" /> | |
| 39 | + <link rel="stylesheet" href="<?php echo esc_url(BITFORMS_UPLOAD_BASE_URL . $baseConversationalCSSPath) ?>" /> | |
| 40 | + | |
| 35 | 41 | <?php if (file_exists(BITFORMS_CONTENT_DIR . $customCSSPath)) : ?> |
| 36 | - <link rel="stylesheet" href="<?= BITFORMS_UPLOAD_BASE_URL . $customCSSPath ?>" /> | |
| 42 | + <link rel="stylesheet" href="<?php echo esc_url(BITFORMS_UPLOAD_BASE_URL . $customCSSPath) ?>" /> | |
| 37 | 43 | <?php endif; ?> |
| 38 | 44 | |
| 39 | 45 | <?php if (file_exists(BITFORMS_CONTENT_DIR . $standaloneCSSPath)) : ?> |
| 40 | - <link rel="stylesheet" href="<?= BITFORMS_UPLOAD_BASE_URL . $standaloneCSSPath ?>" /> | |
| 46 | + <link rel="stylesheet" href="<?php echo esc_url(BITFORMS_UPLOAD_BASE_URL . $standaloneCSSPath) ?>" /> | |
| 41 | 47 | <?php endif; ?> |
| 42 | 48 | |
| 43 | 49 | <?php if (isset($font) && '' !== $font) : ?> |
| 44 | - <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| 45 | - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| 46 | - <link rel="stylesheet" href="<?= $font ?>" /> | |
| 50 | + <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| 51 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| 52 | + <link rel="stylesheet" href="<?php echo esc_url($font) ?>" /> | |
| 47 | 53 | <?php endif; ?> |
| 48 | 54 | |
| 49 | 55 | </head> |
| 56 | + | |
| 50 | 57 | <body class="bit-conversational-form"> |
| 51 | - <?=$formHTML?> | |
| 58 | + <?php echo $formHTML?> | |
| 52 | 59 | <script> |
| 53 | - <?= $bfGlobals ?>; | |
| 60 | + <?php | |
| 61 | +echo $bfGlobals; | |
| 62 | +$jsPath = BITFORMS_UPLOAD_BASE_URL . '/form-scripts/bitform-conversational-' . $formID . '.js'; | |
| 63 | +?>; | |
| 54 | 64 | </script> |
| 55 | - <script src="<?= BITFORMS_UPLOAD_BASE_URL ?>/form-scripts/bitform-conversational-<?= $formID ?>.js"></script> | |
| 65 | + <script src="<?php echo esc_url($jsPath) ?>"> | |
| 66 | + </script> | |
| 56 | 67 | </body> |
| 68 | + | |
| 57 | 69 | </html> |