diff --git a/inc/manager.php b/inc/manager.php index a8925a90..ffb713c7 100644 --- a/inc/manager.php +++ b/inc/manager.php @@ -453,10 +453,11 @@ public function replace_content( $html, $partial = false ) { if ( ! $this->page_profiler->exists_all( $profile_id ) ) { $missing = $this->page_profiler->missing_devices( $profile_id ); $time = time(); - $hmac = wp_hash( $profile_id . $time . $this->get_current_url(), 'nonce' ); + $url = esc_url( esc_js( $this->get_current_url() ) ); + $hmac = wp_hash( $profile_id . $time . $url, 'nonce' ); $js_optimizer = str_replace( [ Profile::PLACEHOLDER, Profile::PLACEHOLDER_MISSING, Profile::PLACEHOLDER_TIME, Profile::PLACEHOLDER_HMAC, Profile::PLACEHOLDER_URL ], - [ $profile_id, implode( ',', $missing ), strval( $time ), $hmac, $this->get_current_url() ], + [ $profile_id, implode( ',', $missing ), strval( $time ), $hmac, $url ], $js_optimizer ); $html = str_replace( Optml_Admin::get_optimizer_script( true ), $js_optimizer, $html );