Unexpected '|' Unexpected '|'
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Unexpected '|'

Started by buddybuddha, October 16, 2005, 05:17:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

buddybuddha

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?

Nibbler

You need to escape the single quote, ie

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

buddybuddha

Im still getting that line 334 error.

Stramm

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?


buddybuddha

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']);
}


Tranz

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.