Fork me on GitHub

#1 2012-10-03 15:51:51

Guzle
Member
Registered: 2012-09-28
Posts: 7

[FIXED] Brackets '[' or ']'

The oneye VFS seems to be having trouble with the [ and/or ] sign. I recently started downloading torrents with my web desktop by putting a file in a Watch directory so the torrent daemon can pick them up. My downloaded files then appear in my Downloads folder.

However, since a lot of torrents have brackets in their folder and filenames: e.g. [2005] [HDTV] I'm unable to open, edit or download the file. Is this known and is there there a cause / remedy?

Thanks a million times

Offline

#2 2012-10-03 19:23:05

s0600204
Member
From: UK
Registered: 2012-01-22
Posts: 118
Website

Re: [FIXED] Brackets '[' or ']'

Hi Guzle,

The reason why the '[' and ']' symbols are giving you problems is because they are in a character blacklist that prevents them from being used in file and folder names within oneye. In other words, it's not only known, it's intentional. Ordinarily you shouldn't be able to create files with these symbols, nor rename files to include them so it's not an issue, but I'm guessing the torrent downloader you're using is external to oneye and so is not subject to its restrictions. Hence oneye gets confused when it comes across files with '[' and/or ']' in the names.

Looking into why the '[' and ']' symbols are in the blacklist in the first place took me to look up svn revision 3096 when they were first introduced (by afiestas). Unfortunately, no explanation is given in the commit log. So much for that. Running a few basic tests on a system with the blacklist disabled reveals that files with names with both '[' and ']' in them, in that order, confuses the vfs service somewhat ("abc[", "abc]", "abc][" all work but "abc[]" causes an error) - but only when running the Virtual vfs module.

I'm guessing you're using the Real vfs module? Well, I've found no problems so far with filenames including these symbols when running the Real module - not that I've had time to look particularly hard. If you're willing to be a 'guinea pig' of sorts, what I suggest is removing the '[' and ']' symbols from the blacklist, and seeing if that helps you. If it does and, after a few months of use you can't find any problems with using '[' and ']' in filenames when using the Real module, then we could consider editing the repository so everyone can benefit.

To remove the symbols from the blacklist (Real module):

  1. On the server, locate and open the file [EYEROOT]/system/services/vfs/modules/real.eyecode

  2. Go to line 28-29:

    global $charBlackList;
    $charBlackList = array("/","\\","<",">","[","]","htaccess","php.ini");
  3. Remove the symbols from the array:

    global $charBlackList;
    $charBlackList = array("/","\\","<",">","htaccess","php.ini");
  4. Save and close the file. Refresh your browser.

If all goes well, you should be able to use the '[' and ']' symbols in filenames. Just, please don't do this with the Virtual vfs module.

Hope this helps.

Offline

#3 2012-10-03 20:53:23

Guzle
Member
Registered: 2012-09-28
Posts: 7

Re: [FIXED] Brackets '[' or ']'

Wow! What a great answer, you're the best. It's true that I use the real VFS, and I will try the above.

I'll have it run for a while and then report back if it causes any anomalies or not.

Thank you ever so much

Last edited by Guzle (2012-10-03 20:56:04)

Offline

#4 2012-10-03 23:48:51

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: [FIXED] Brackets '[' or ']'

Would like like to have a pull request for the real fs and an issue created for the virtual one in order to check this in time.

Sorry guys, I'm quite busy, so let's try moving all this stuff to GitHub wink ...


Best regards,
Lars Knickrehm

The oneye project.

Offline

#5 2013-01-22 11:49:36

Guzle
Member
Registered: 2012-09-28
Posts: 7

Re: [FIXED] Brackets '[' or ']'

Hey, sorry for the looong delay.

The blacklist fix worked fine, no more bracket problems.

Thanks!

Offline

#6 2013-01-22 17:25:03

s0600204
Member
From: UK
Registered: 2012-01-22
Posts: 118
Website

Re: [FIXED] Brackets '[' or ']'

Thank you Guzle for your help.

A pull request has been made to merge this change into the main repository: https://github.com/oneye/oneye/pull/16

Offline

#7 2013-01-22 17:28:47

lars-sh
Administrator
From: near Hamburg, Germany
Registered: 2011-07-14
Posts: 731
Website

Re: [FIXED] Brackets '[' or ']'

Just merged it into master.


Best regards,
Lars Knickrehm

The oneye project.

Offline

Board footer

Powered by FluxBB