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

invalid upload file names

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.3.12
    • None
    • None

      I use an iOS shortcut called "Apple frames", while it's very useful (it basically wraps screenshots with the right phone background that the screenshot was taken on), it has the peculiar behavior of changing the file name to the date. The file name is valid on iOS, but no where else (it uses the : for the time separator).

      As I was trying to understand why I cant directly upload the file to phpbb, since files->common_check gives an INVALID_FILENAME error, I noticed something strange. The system actually now uses clean_filename('unique' but it still checks the common_check before that, despite it no longer being relevant as the realname later gets replaced with the hash anyway...

      To test this theory I tried to see what happens if I remove this check and indeed, it all works as expected (because clean_filename('unique') runs later on anyway...

      the issue is in: /phpbb/phpbb/files/upload.php

       
      /* 
      // check Filename if (preg_match("#[\\/:*?\"<>|]#i", $file->get('realname'))) { $file->error[] = $this->language->lang($this->error_prefix . 'INVALID_FILENAME', $file->get('realname')); } 
      */

       
      {{}}

            Unassigned Unassigned
            oferlaor oferlaor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: