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

Extensions are not located when front-end file has a diffferent phpbb_root_path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.1.0-a1
    • 3.1.0-dev
    • Extensions
    • None

      In the extension finder is some code which removes the phpbb_root_path (but only if it is "./") and reappends it for the checks later.

      When your front-end file is not inside the phpbb root, but a subfolder and therefor your root path is "../" it does not get removed, but is prepended later again. The the finder tries to locate the extensions in ../../ instead of ../

      	/**
      	* Removes occurances of /./ and makes sure path ends without trailing slash
      	*
      	* @param string $directory A directory pattern
      	* @return string A cleaned up directory pattern
      	*/
      	protected function sanitise_directory($directory)
      	{
      		$directory = preg_replace('#(?:^|/)\./#', '/', $directory);
      		$dir_len = strlen($directory);
       
      		if ($dir_len > 1 && $directory[$dir_len - 1] === '/')
      		{
      			$directory = substr($directory, 0, -1);
      		}
       
      		return $directory;
      	}

      This function in phpBB\includes\extension\finder.php must be modified to replace the first occurance of

      '/' . $phpbb_root_path

      with

      /

      and afterwards remove all

      /./

            nickvergessen Joas Schilling
            nickvergessen Joas Schilling
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: