Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10844

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.1.0-dev
    • 3.1.0-a1
    • Extensions
    • None

    Description

      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

      /./

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: