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

Undefined variable $browser in /download/file.php

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.12-RC2
    • Fix Version/s: 3.0.12-RC3
    • Component/s: Other
    • Labels:
      None

      Description

      As per https://www.phpbb.com/community/viewtopic.php?f=46&t=2194030

      Page: download/file.php?id=155&mode=view
      File: [ROOT]/download/file.php
      Line: 288 [PHP Notice]

      Undefined variable: browser

      This happens when guests view attachments.

      Looks legit, as $browser may be uninitialized.

        Issue Links

          Activity

          Hide
          dhruv.goel92 Dhruv Goel added a comment - - edited

          Solution from what I could tell is to replace $browser with $user->browser on line 288

          Show
          dhruv.goel92 Dhruv Goel added a comment - - edited Solution from what I could tell is to replace $browser with $user->browser on line 288
          Hide
          bantu Andreas Fischer added a comment -

          Yes. That's pretty clear when looking at the https://github.com/phpbb/phpbb3/pull/1226 diff properly.

          Show
          bantu Andreas Fischer added a comment - Yes. That's pretty clear when looking at the https://github.com/phpbb/phpbb3/pull/1226 diff properly.
          Hide
          AmigoJack AmigoJack added a comment -

          No it's not, since the file creates it's own $browser variable in a condition (line 59). Hence the code might be right, but the variable is just uninitialized. Please double-check.

          Show
          AmigoJack AmigoJack added a comment - No it's not, since the file creates it's own $browser variable in a condition (line 59). Hence the code might be right, but the variable is just uninitialized. Please double-check.
          Hide
          bantu Andreas Fischer added a comment - - edited

          The global variable $browser is only used in the avatar code path. Otherwise, common.php is loaded and $user->browser is used.

          Show
          bantu Andreas Fischer added a comment - - edited The global variable $browser is only used in the avatar code path. Otherwise, common.php is loaded and $user->browser is used.

            People

            • Assignee:
              dhruv.goel92 Dhruv Goel
              Reporter:
              AmigoJack AmigoJack
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development