| @@ -69,9 +69,9 @@ | ||
| 69 | 69 | |
| 70 | 70 | ?> |
| 71 | 71 | <script id="bwp-heartbeat"> |
| 72 | 72 | (function() { |
| 73 | - var config = <?php echo json_encode($config); ?>; | |
| 73 | + var config = <?php echo wp_json_encode($config); ?>; | |
| 74 | 74 | var active = true; |
| 75 | 75 | var failures = 0; |
| 76 | 76 | var maxFailures = 3; |
| 77 | 77 | var beatCount = 0; |
| @@ -491,9 +491,9 @@ | ||
| 491 | 491 | |
| 492 | 492 | private function get_current_url(): string |
| 493 | 493 | { |
| 494 | 494 | $protocol = is_ssl() ? 'https://' : 'http://'; |
| 495 | - return $protocol . $_SERVER['HTTP_HOST'] . strtok($_SERVER['REQUEST_URI'], '?'); | |
| 495 | + return $protocol . sanitize_text_field(wp_unslash($_SERVER['HTTP_HOST'] ?? '')) . strtok(sanitize_text_field(wp_unslash($_SERVER['REQUEST_URI'] ?? '/')), '?'); | |
| 496 | 496 | } |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | // add_action('init', fn() => new berqHeartbeat()); |