Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › PHP Notice with the new update › Reply To: PHP Notice with the new update
December 30, 2015 at 1:21 pm
#7197
Hi!
I’ve googled a bit about this issue, and most likely there might have been a change on your hosting – either IPv6 address or something similar. This code has been around before the update, you just probably didn’t get notices before that.
Can you please try to replace the code with this modified version of this function?
function wd_current_page_url() {
$pageURL = 'http';
$port = !empty($_SERVER["SERVER_PORT"]) ? $_SERVER["SERVER_PORT"] : 80;
$server_name = !empty($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : "";
$server_name = empty($server_name) && !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $server_name;
if( isset($_SERVER["HTTPS"]) ) {
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
}
$pageURL .= "://";
if ($port != "80") {
$pageURL .= $server_name.":".$port.$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $server_name.$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
let me know if you see any notices with the change.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
![](https://wp-dreams.com/assets/envato/comment-button-knowledgebase.png)
![](https://wp-dreams.com/assets/envato/comment-button-support.png)
![](https://wp-dreams.com/assets/envato/comment-button-facebook.png)
![](https://wp-dreams.com/assets/envato/comment-button-twitter.png)