coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: RaptorUK on May 19, 2005, 09:11:32 PM

Title: 1.3.3 language flag bug ?
Post by: RaptorUK on May 19, 2005, 09:11:32 PM
I have just upgraded from 1.2.2 to 1.3.3 reading and following all the instructions to the letter, except for backing up my MySQL database,  i wasn't sure how to do it so I took a chance.  Everything seems to be OK . . . I decided to have a look at the new Config options and turned on Display Language Flags   . . .  the flags are there but the link to a directory I don't have,  e.g. http://www.f1album.com/execscriptdir/php.cgi?lang=german   so I get a HTTP 500 error . . .   have I don't something wrong or is this a bug ?

thanks.
Title: Re: 1.3.3 language flag bug ?
Post by: Nibbler on May 19, 2005, 09:24:02 PM
You have an unusual server setup, try this code change.

init.inc.php, find

$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];


and replace it with

$PHP_SELF = '';
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
$PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
break;
}
}
Title: Re: 1.3.3 language flag bug ?
Post by: RaptorUK on May 19, 2005, 09:34:14 PM
Hey,  thanks Nibbler,  quick and effective response   ;D   Welsh has a problem but I can live with that  :D  (Parse error: parse error, unexpected T_STRING, expecting ')' in /home/a/l/album/public_html/lang/welsh.php on line 808)  hell,  I might even be able to fix that myself . . .

Would you mind explaining in a sentence or 2 what the change has done,  I'm trying to learn as I go  ;D
Title: Re: 1.3.3 language flag bug ?
Post by: RaptorUK on May 19, 2005, 09:40:09 PM
LOL, fixed the Welsh . . . line 808    'Wyt ti\\'n si      should be    'Wyt ti\'n si  I think . . .  ;D
Title: Re: 1.3.3 language flag bug ?
Post by: Nibbler on May 19, 2005, 09:42:31 PM
The server variable $_SERVER['SCRIPT_FILENAME'] is supposed to hold the name of the file being run on the server ie index.php. Instead it has that incorrect path. What the new code does is try to find out the right value for the variable and correct it.

The welsh language file is missing a \, I will go correct it.
Title: Re: 1.3.3 language flag bug ?
Post by: RaptorUK on May 19, 2005, 09:58:48 PM
Nibbler,

before I started the upgrade I renamed the V 1.2.2 README.html file to index.html so that users wouldn't get a blank/confusing page while I was doing the 1.2.2 to 1.3.3 upgrade . . .  this wouldn't have caused my issue would it ?   ???
Title: Re: 1.3.3 language flag bug ?
Post by: Nibbler on May 19, 2005, 10:16:29 PM
That wouldn't have caused it.