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

Paths can break for extensions with deep route patterns/paths

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.2.0-dev
    • 3.2.0-b2
    • None
    • None

    Description

      I have an extension with a page located at the route:

      app.php/foo/bar
      

      In this case, it fails to load any files from the core's assets folder (ie: editor.js) when the file is included using INCLUDEJS or INCLUDECSS.

      For example, the page in this extension includes phpBB's posting_buttons.html template, which has the line:

      <!-- INCLUDEJS {T_ASSETS_PATH}/js/editor.js -->
      

      Even though T_ASSETS_PATH has the correct value of

      ./../assets
      

      when the page is rendered, in the source code you get an extra relative path, ie:

      ./../../assets
      

      which seems to be coming from update_web_root_path() and confusion from the fact that the route is nested one "/" level deeper than if it were simply app.php/foo

      TO reproduce the error, try the phpbb/ideas extension in phpBB 3.2-a2 and go to the New Idea posting page and you will see BBCode and smiliey buttons are broken because the editor.js is not found (even though its all inherited from phpbb/prosilver). Then just look at the source code and you see that editor.js (the only asset file included by INCLUDEJS) has an extra /../ than any other asset files.

      Attachments

        Activity

          People

            nicofuma nicofuma
            VSE Matt Friedman [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: