Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-21637 bug in some versions of php version 5 prevents cookieless s…

…essions working. Using static variable to store data from CFG on first call to fix problem.
  • Loading branch information...
commit 72336b7f93acb2a749c791856d30a4bcd7b0ec06 1 parent 5425c4d
@jamiepratt jamiepratt authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/cookieless.php
View
10 lib/cookieless.php
@@ -67,8 +67,16 @@ function sid_rewrite_link_tag($matches){
*/
function sid_process_url($url) {
global $CFG;
+ static $wwwroot = null;
+ static $httpswwwroot = null;
+ if ($wwwroot == null){
+ $wwwroot = $CFG->wwwroot;
+ }
+ if ($httpswwwroot == null){
+ $httpswwwroot = $CFG->httpswwwroot;
+ }
if ((preg_match('/^(http|https):/i', $url)) // absolute url
- && ((stripos($url, $CFG->wwwroot)!==0) && stripos($url, $CFG->httpswwwroot)!==0)) { // and not local one
+ && ((stripos($url, $wwwroot)!==0) && stripos($url, $httpswwwroot)!==0)) { // and not local one
return $url; //don't attach sessid to non local urls
}
if ($url[0]=='#' || (stripos($url, 'javascript:')===0)) {
Please sign in to comment.
Something went wrong with that request. Please try again.