Closed gags88 closed 8 years ago
Not sure what that is. What is the code on line 64 of system/library/v2pagecache.php ?
Also, did you clear the cache and restart apache or whatever your webserver is?
And, also, you did uninstall the old module, and reinstall the new module, right? You didn't just copy/replace a single file, right?
Clean install helped....
It is again here.. Now on line 62
Line says if (array_key_exists('language',$svar)) {
What's the error? You're showing me code, but not the associated error.
2016-10-18 21:28:40 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/abc/public_html/system/library/v2pagecache.php:62) in /home/abc/public_html/index.php on line 240 2016-10-18 21:28:40 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/abc/public_html/system/library/v2pagecache.php:62) in /home/abc/public_html/system/library/currency.php on line 45 2016-10-18 21:28:42 - PHP Warning: Cannot modify header information - headers already sent by (output started at /home/abc/public_html/system/library/v2pagecache.php:62) in /home/abc/public_html/vqmod/vqcache/vq2-catalog_controller_module_lastviewed.php on line 32
I can't reproduce that on my machine, so there's not much I can do about it.
Since the error doesn't really relate to the code, it seems like an unclean install or similar. Something where you would want to clear the cache, uninstall, reinstall, restart the web server, restart fastcgi, etc.
but i am getting it very often.. i have cleared all cache and uninstalled and then installed.. What else i supposed to do?
i can't restart Webserver as i am on shared hosting
Sorry, I have no idea. I cannot reproduce that here. What else would I do?
What about these errors?
Warning: array_key_exists() expects parameter 2 to be array, null given in /home/abc/public_html/system/library/v2pagecache.php on line 63
Warning: array_key_exists() expects parameter 2 to be array, null given in /home/abc/public_html/system/library/v2pagecache.php on line 70
I think you need to change the block like as below
$svar=$this->GetSessionVar(); if(isset($svar)){ if (array_key_exists('language',$svar)) { // only accept specific strings for $_SESSION['language'] // (two small letters, optionally followed by - and more letters) if (pregmatch('/^[a-z]{2}-[a-zA-Z]_$/',$svar['language'])) { $this->lang=$svar['language']; } } if (array_key_exists('currency',$svar)) { // only accept 3 consecutive A-Z for $_SESSION['language'] if (preg_match('/^[A-Z]{3}$/',$svar['currency'])) { $this->currency=$svar['currency']; } } }
Try editing it and change to: if (is_array($svar) && array_key_exists('language',$svar)) { and if (is_array($svar) && array_key_exists('currency',$svar)) {
If that works for you, I'll create a new version with a similar fix. Probably not today though.
I uploaded a new version with those fixes.
Hi, this is continuation of thread
https://github.com/budgetneon/v2pagecache/issues/18
After changing to new file, There are many PHP warnings: