| @@ -1,4 +1,10 @@ | ||
| 1 | +<?php | |
| 2 | +if (!defined('ABSPATH') && !defined('BITFORMS_ASSET_URI')) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +?> | |
| 6 | + | |
| 1 | 7 | <!DOCTYPE html> |
| 2 | 8 | <html lang="en"> |
| 3 | 9 | |
| 4 | 10 | <head> |
| @@ -4,9 +10,9 @@ | ||
| 4 | 10 | <head> |
| 5 | 11 | <meta charset="UTF-8"> |
| 6 | 12 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 13 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 8 | - <title><?php echo isset($title) ? $title : ''; ?></title> | |
| 14 | + <title><?php echo isset($title) ? esc_html($title) : ''; ?></title> | |
| 9 | 15 | <style> |
| 10 | 16 | html, |
| 11 | 17 | body { |
| 12 | 18 | min-height: 100%; |
| @@ -19,11 +25,9 @@ | ||
| 19 | 25 | flex-direction: column; |
| 20 | 26 | /* background-color: #f1f1f1; */ |
| 21 | 27 | } |
| 22 | 28 | |
| 23 | - ._frm-bg-b<?php echo $formID; | |
| 24 | - | |
| 25 | - ?> { | |
| 29 | + ._frm-bg-b<?php echo esc_html($formID) ?> { | |
| 26 | 30 | width: 600px; |
| 27 | 31 | margin-block: 100px; |
| 28 | 32 | } |
| 29 | 33 | </style> |
| @@ -28,34 +32,39 @@ | ||
| 28 | 32 | } |
| 29 | 33 | </style> |
| 30 | 34 | <?php |
| 31 | 35 | $formUpdateVersion = get_option('bit-form_form_update_version'); |
| 32 | - ?> | |
| 33 | - <link rel="stylesheet" | |
| 34 | - href="<?php echo BITFORMS_UPLOAD_BASE_URL?>/form-styles/bitform-<?php echo $formID?>.css?ver=<?php echo $formUpdateVersion?>" /> | |
| 36 | +$bitformCssUrl = BITFORMS_UPLOAD_BASE_URL . '/form-styles/bitform-' . $formID . '.css?bfv=' . $formUpdateVersion; | |
| 37 | +?> | |
| 38 | + <link rel="stylesheet" href="<?php echo esc_url($bitformCssUrl) ?>" /> | |
| 35 | 39 | <?php |
| 36 | - $customCssSubPath = "/form-styles/bitform-custom-{$formID}.css"; | |
| 37 | - ?> | |
| 40 | +$customCssSubPath = "/form-styles/bitform-custom-{$formID}.css"; | |
| 41 | + | |
| 42 | +$customJsPath = BITFORMS_UPLOAD_BASE_URL . $customCssSubPath . '?ver=' . $formUpdateVersion; | |
| 43 | +?> | |
| 38 | 44 | <?php if(file_exists(BITFORMS_CONTENT_DIR . $customCssSubPath)) : ?> |
| 39 | - <link rel="stylesheet" | |
| 40 | - href="<?php echo BITFORMS_UPLOAD_BASE_URL . $customCssSubPath ?>?ver=<?php echo $formUpdateVersion?>" /> | |
| 45 | + <link rel="stylesheet" href="<?php echo esc_url($customJsPath) ?>" /> | |
| 41 | 46 | <?php endif; ?> |
| 42 | 47 | |
| 43 | 48 | <?php if (isset($font) && '' !== $font): ?> |
| 44 | 49 | <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 45 | 50 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 46 | - <link rel="stylesheet" href="<?php echo $font?>" /> | |
| 51 | + <link rel="stylesheet" href="<?php echo esc_url($font)?>" /> | |
| 47 | 52 | <?php endif; ?> |
| 48 | 53 | |
| 49 | 54 | </head> |
| 50 | 55 | |
| 51 | 56 | <body> |
| 52 | - <?php echo $formHTML?> | |
| 57 | + <?php echo $formHTML ?> | |
| 53 | 58 | |
| 54 | 59 | <script> |
| 55 | 60 | <?php echo $bfGlobals?>; |
| 61 | + | |
| 62 | + <?php | |
| 63 | + $previewJsPath = BITFORMS_UPLOAD_BASE_URL . '/form-scripts/preview-' . $formID . '.js'; | |
| 64 | +?> | |
| 56 | 65 | </script> |
| 57 | - <script src="<?php echo BITFORMS_UPLOAD_BASE_URL?>/form-scripts/preview-<?php echo $formID?>.js"></script> | |
| 66 | + <script src="<?php echo esc_url($previewJsPath) ?>"></script> | |
| 58 | 67 | |
| 59 | 68 | </body> |
| 60 | 69 | |
| 61 | 70 | </html> |