coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: buddybuddha on October 16, 2005, 05:17:56 AM

Title: Unexpected '|'
Post by: buddybuddha on October 16, 2005, 05:17:56 AM
Ok sorry guys if Im posting about an error that shows up a lot.  I searched the forums for something similar but couldnt find a solution.

When I boot up my image gallery I get the following:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/buddybud/public_html/Version3/PhotoGall/include/init.inc.php on line 334

Line 334 is

include('include/select_lang.inc.php');

Also before this I had edited 332 to get rid of another error which probably caused the second error.

Line 332 is now

$CONFIG['lang'] = strtr($USER['lang'], '$/\:*?"'<>`|', '____________');

Ogain real sorry if this happened before.  Can anyone help me?
Title: Re: Unexpected '|'
Post by: Nibbler on October 16, 2005, 05:24:04 AM
You need to escape the single quote, ie

$CONFIG['lang'] = strtr($USER['lang'], '$/\:*?"\'<>`|', '____________');
Title: Re: Unexpected '|'
Post by: buddybuddha on October 16, 2005, 05:43:10 AM
Im still getting that line 334 error.
Title: Re: Unexpected '|'
Post by: Stramm on October 16, 2005, 11:14:06 AM
next time show us a few lines more of the code. That's easier then... and you need to escape the \ too

$CONFIG['lang'] = strtr($USER['lang'], '$/\\:*?"\'<>`|', '____________');

why not go back to the orig and tell us your initial error?

Title: Re: Unexpected '|'
Post by: buddybuddha on October 16, 2005, 08:53:29 PM
I accidentally lost thhe oricinal and I cant find an archive dl for the 1.3.3 version of the software.

But the original error if my memory serves me correctly was unexpected '|' on line 32.

Heres lines 330-342

$USER['lang'] . '.php')) {
$CONFIG['default_lang'] = $CONFIG['lang'];          // Save default language
$CONFIG['lang'] = strtr($USER['lang'], '$/\\:*?"\'<>`|', '____________');
} elseif ($CONFIG['charset'] == 'utf-8') {
include('include/select_lang.inc.php');
if (file_exists('lang/' . $USER['lang'] . '.php')) {
$CONFIG['default_lang'] = $CONFIG['lang'];      // Save default language
$CONFIG['lang'] = $USER['lang'];
}
} else {
unset($USER['lang']);
}

Title: Re: Unexpected '|'
Post by: Tranz on October 16, 2005, 09:15:17 PM
Is there a reason you must use 1.3.3? You should upgrade to 1.3.5 to fix some security issues. Let's see if this also solves your problem.