From: Melvyn S. <md...@id...> - 2003-10-06 16:21:06
|
On Monday 06 October 2003 12:54, Markus Illenseer wrote: > > >> did you try my really simple fix, just so we could see if we'd > > >> correctly identify the problem? > > relocated the fix and applied it -- to no avail so far. Remember, I dont > have "locale" anyway. On my system it should jump to this line: > > } elseif (@is_readable("/usr/share/locale/")) { > > I do have gettext(), though, and am not OS_LINUX :-) Yes, us BSD people get pushed into that 'not windows, so linux' corner a=20 lot :) > I have pinpoint the error so far to the call of config_maybe_locales() in > config_data.inc. Removing (!) the call, finishes the array_merge() > successfully for the constants beeing defined (the web page being > displayed is useless, of course). I believe this means, that the returned > array of config_maybe_locales() is incorrect or currupt; however, I cannot > trace php into config_maybe_locales() at all -- no print "test"; seems to > make it out to the world, just as if the function never gets called. That's quite logical I think. It'll be in the apache output bucket when it= =20 crashes. Try: error_log(var_export(debug_backtrace(), TRUE))); before the call to and inside the function config_maybe_locales(). Make sur= e=20 log_errors_max_len =3D 0 in php.ini (or httpd.conf for that vhost). I think there's a very good potential that that foreach loop is endless,=20 because: 1) It's not properly indented 2) As far as I can see due to 1), it does a foreach on $maybe within a fore= ach=20 on $maybe. If you run top(1) and then request the page, do see a lot of spinning of on= e=20 httpd binary - usually a good indication of an endless loop. Now - to the actual cause of this, may be in gallery/util.php, function=20 gallery_languages(). =46irst of all, the preg_match on line 2877 is a little bogus: * There are brackets, but no capturing or backreferencing is done, so you c= an=20 loose them * It will match anything that's currently in there - ok that may a be good= =20 thing, considering users(8) are not to be trusted. The problem is, that this function is supposed to create an array, which wi= ll=20 be matched against the locale's on a system. On BSD's, all locales are of=20 format: [a-z]{2}_[A-Z]{2}\.[A-Z0-9_-]+ Ie: character sets are always appended to the language identifier. So, even= =20 though my system has over 180 locales, all 28 locales from gallery are not= =20 recognized, because: # functions.inc if ( (in_array($locale, $system_locales)) || (setlocale(LC_ALL, $locale))) { always fails. =2D-=20 Melvyn |