Page 1 of 1

"_" in folder names

Posted: 02 Dec 2014, 10:11
by TobseEgg
Hello,

since I updated to Beta V0.5 I get an Error 404 when opening a folder with "_" in the directory name like

/te_st/

(After downgrading to 0.3 or 0.4 (I'm not exactly shure which version the backup was...) everything is working again)

Re: "_" in folder names

Posted: 02 Dec 2014, 23:42
by mjau-mjau
Works fine here, and I can't recall anything we added that reacts upon the _underscore character. I will need to see a link to diagnose this ...
Image

Re: "_" in folder names

Posted: 04 Dec 2014, 08:56
by TobseEgg
Hello,
here's a link:
http://tobiaseggensberger.de/galerien/v ... Gustavsen/

I attached an Image of the two Beta versions.

Alternatively here is a complete fresh installation: http://test1.tobiaseggensberger.de/x3/b0_5/
And the same Pages copied to a new 0.3-installation: http://test1.tobiaseggensberger.de/x3/b0_3/

Thank you,
Tobias

Re: "_" in folder names

Posted: 04 Dec 2014, 10:23
by mjau-mjau
I find it strange that it works here, but not at your place. It could be there was something in last release which was not done properly, and then fixed after ... I will have a new version ready tomorrow, and we can check then ... If the update doesn't fix anything, I will probably want to look at the .htaccess file ...

Re: "_" in folder names

Posted: 04 Dec 2014, 12:42
by margouillat
I noticed the same problem with the name of the pictures if the name starts with "_" (_DSC3629.jpg).
the picture appears when I remove, it work.

Re: "_" in folder names

Posted: 04 Dec 2014, 13:06
by mjau-mjau
margouillat wrote:I noticed the same problem with the name of the pictures if the name starts with "_" (_DSC3629.jpg).
the picture appears when I remove, it work.
This is a specific rule to hide all files and folders that start with _underscore. It has many uses, for example creating inaccessible/unpublished folders or adding images that are hidden from a page's gallery but still available to load.

Re: "_" in folder names

Posted: 06 Dec 2014, 13:31
by TobseEgg
I installed b0.6 but the behaviour didn't change.


In 'app/stacey.inc.php' there is a preg_replace (Line 157) which replaces the underscore character ('/[\.|\_][\w\d]+?$/').
When I remove the _ character from the parameters so that it's the same code as it was in 0.3 (only '/[\.][\w\d]+?$/' remain) everything works fine (At least when I type in the URL. Internal links don't work).
(I dont know if that's the right approach, just had some time to play :wink: )

Re: "_" in folder names

Posted: 07 Dec 2014, 01:03
by mjau-mjau
Yes, I thought it might be related to this, and I'm impressed you manage to debug this yourself. It has to be said though, the fix added there is because we need to "rewrite" calls to load the ajax JSON file for servers with the rewrite option disabled (thus your fix is acceptable in your case).

Ultimately, this issue stems from a problem in your folder name "1210_TordGustavsen". The number in front of . or _ basically represents the numbering order of the folder, and thus leaves "_TordGustavsen", which with an underscore in front, effectively means a "hidden" folder. I believe it would work find if your folder was named "F1210_TordGustavsen" (eg. with a non-numeral character first, or "1210-TordGustavsen" (eg without the _underscore char).

I will look into this ...

Re: "_" in folder names

Posted: 10 Dec 2014, 09:34
by Bulletproof IT
Why not just use: "TordGustavsen.1210" or instead of "." try and use a "_" or "-" or ","
Have you tried these separators instead of _?

Re: "_" in folder names

Posted: 10 Feb 2015, 10:28
by mjau-mjau
The folder name _underscore issue has now been fixed, and is pending release in v0.9.

Having said that, I would strongly recommend against using _ underscores in physical folder names in the first place. Folder names are what is displayed in the URL of the page, and should be as simple and pretty as possible. If you cannot restrict it to a single word, then use hyphens -

"Mount Everest"
domain.com/everest/ [BEST]
domain.com/mount-everest/ [STANDARDS]
domain.com/mount_everest/ [NO THNX]