Closed (fixed)
Project:
Boost
Version:
6.x-1.x-dev
Component:
Internationalization
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Nov 2008 at 17:28 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rsvelko commentedanother option may be to make pathauto transliterate (with the help of the transliteration module ) urls to ascii (not always wanted though) (google knows about transliteration and will list your cyrillic pages no matter how do you search them or what their url (latin or cyr) )
Cheers from a bulgarian.
Comment #2
rsvelko commentedI tried the latest boost 6.x.dev on Drupal 6.10 with the german title of a node "Österreich park test of the unlaut" with the path alias of "http://freizeitpark.co.at/%C3%B6sterreich-park-test-unlaut" (attached a screenshot - cause the link may dissapear soon)
the analoguous line to comment in 6.x is the 583 line of .module file. (search for a "a-z" string on line with preg_replace - it is the only one)
After commenting it the boost static cache of the special page works - both the boost comment and the loading times improved...
in bash when listing the symlink it has a ?? in the place of the "Ö" char but it works in the browser - I guess I should germanize my bash...
issue changed to 6.x version. and issue title changed
Comment #3
rsvelko commentedhey, guys tested this line commenting on several of my sites - it works nice. I wonder what could go wrong if we patch boost that way? Which chars are meant to be removed by this preg_replace (except for non-UNICODE)?
Most sites use pathauto which by default is set to remove odd chars (!@$%$^&) from the alias.... so?
Need review - anybody?
The proposed patch is :
// Convert any other undesirable characters in the path to underscores:
- $path = preg_replace('@[^/a-z0-9_\-&=,\.:]@i', '_', $path);
...
Remove/comment the 2nd line.
Comment #4
mikeytown2 commentedHaving this as a setting that you can click on or off would be a better idea IMHO. It was originally put in there for a reason, so it has to be useful to someone.
Comment #5
rsvelko commentedI want to know the reason. Then comes the setting-patch.
Comment #6
mikeytown2 commentedI think this is the reason
http://tools.ietf.org/html/rfc3986#section-2
But as noted, this is for the filename not the url. Apache should change the Percent-Encoding back to its original UTF-8 character string. Can more people please test this out, as I'm starting to think that boost was over compensated when dealing with non ASCII characters.
Comment #7
rsvelko commentedI do not fully understand the theory behind this and the exact process but here is what I observe:
- name of page:
Elvia Mondial Reiseversicherung Österreich
- url of the page:
/elvia-mondial-reiseversicherung-%C3%B6sterreich - percent encoding for non-ascii unicode chars - the encoded Char is the capital german letter Ö .
- url as copied from ff addressbar
http://versichern24.org/elvia-mondial-reiseversicherung-%C3%B6sterreich
- url visually in the ff address bar
http://versichern24.org/elvia-mondial-reiseversicherung-österreich
- path in the file system - seen via ls - 'locale' command output below :
elvia-mondial-reiseversicherung-??sterreich.html
LANG=C
LANGUAGE=de_DE:en_US:de_LU:de_CH:de_BE:de_AT
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
but I won't bother setting my locale right to just see the umlaut characters right - if they work in apache as they do it is ok then ...
I am begining to think that this preg_replace was done just in case cause there was no time to test how would apache/file system manage non-ascii chars ...
If several people from diff. countries and with standart common linux based servers report that it works - then we commit. Some windows server feedback would be good as well though not compulsory to the commit .
The idea about a setting fades away if it works everywhere, right?
Comment #8
mikeytown2 commentedNo need for a boost setting if this works everywhere. Not sure if we will get any windows testing in the near future, since boost hasn't supported windows for very long :). I would like at least 3 other people to test the proposed changes before moving forward. An alt to killing it is detecting if pathauto is installed, if not installed then default to ___
Comment #9
mikeytown2 commentedRelated Issues
#180689: Does not work for URL aliases ending in .html
#364327: boost_file_path generates file names that are never processed by htaccess
#210671: Boost creating wrong cache file names
This is going into the latest dev by mid week, so I'm assuming no news is good news in this case.
Comment #10
mikeytown2 commentedFound something...
URL variables don't get processed, thus they contain spaces. Spaces in the url mess up boost, with that line removed.
info/* are http://drupal.org/project/webform pages.
Comment #11
mikeytown2 commentedComment #12
mikeytown2 commentedCould use http://www.php.net/str_replace to replace all " " with "+" which incorporates #364327: boost_file_path generates file names that are never processed by htaccess. But what else does this patch mess up?
The browsers for those errors according to my stats is IE6 & Safari 1.2.
Comment #13
mikeytown2 commentedThe generated file looks like
contact-us_title=Chariot%20Eagle%20West%20-%20F-22%20.html.gz
On the web server.
Comment #14
mikeytown2 commentedCame up with a better idea.
Comment #15
mikeytown2 commentedComment #16
mikeytown2 commentedeh that doesn't work 100% of the time... leaning more towards a setting that can be turned on/off. Using mb_ereg_replace() instead of preg_replace() with the correct expression would allow the passage of non ASCII characters. Another way of looking at this is figuring out what characters need to be escaped because of apache, allow all others. Adding the output of boost_file_path() to the boost block would be helpful. For now, thinking about using preg_match() and returning false if it doesn't pass. Example from #364327: boost_file_path generates file names that are never processed by htaccess
Comment #17
mikeytown2 commentedBOOST_ONLY_ASCII_PATH is set on the performance page under advanced
Comment #18
mikeytown2 commentedComment #19
mikeytown2 commentedcommitted
Comment #20
rsvelko commentedjust for completeness - checked the php manual:
1. the preg_match above is case insensitive - nice
2. between [] the \ is fine to escape characters such as "." and "-"
All ok.