Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7352

Fatal error: Can't use function return value in write context

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.2
    • 3.0.x
    • Sessions
    • None
    • PHP Environment: 5.2.4-2ubuntu5.1
      Database:

      After updating to latest SVN:

      Fatal error: Can't use function return value in write context in /var/www/phpBB-3_0_0/phpBB/includes/session.php on line 1318

      which gets caused by

              else if ($check_script_path && !empty(rtrim($this->page['root_script_path'], '/'))) 

      Possible fix:

      Index: session.php===================================================================--- session.php (revision 8554)+++ session.php (working copy)@@ -1311,14 +1311,15 @@                }                $host = htmlspecialchars($this->host);                $ref = substr($this->referer, strpos($this->referer, '://') + 3);+               $root_script_path = rtrim($this->page['root_script_path'], '/');                if (!(stripos($ref , $host) === 0))                {                        return false;                }-               else if ($check_script_path && !empty(rtrim($this->page['root_script_path'], '/')))+               else if ($check_script_path && !empty($root_script_path))                {                        $ref = substr($ref, strlen($host));-                       if (!(stripos(rtrim($ref, '/'), rtrim($this->page['root_script_path'], '/')) === 0))+                       if (!(stripos(rtrim($ref, '/'), $root_script_path) === 0))                        {                                return false;                        } 

            Kellanved Kellanved [X] (Inactive)
            Schumi Schumi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: