Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Solved: unexpected T_STRING in cache.php
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1
  • 2

TOPIC: Solved: unexpected T_STRING in cache.php

Re: unexpected T_STRING in cache.php 16 years, 6 months ago #3242

  • cezo
  • OFFLINE
  • Posts: 4
FIXED:
Just add the php command (addslashes) to the variables before the cache file is created so that all special characters will be escaped.

Re: unexpected T_STRING in cache.php 16 years, 6 months ago #3243

cezo wrote:
FIXED:
Just add the php command (addslashes) to the variables before the cache file is created so that all special characters will be escaped.
Can you give an example of this with some code? Thanks.

Would you put this in the cache.php file?

Re: unexpected T_STRING in cache.php 16 years, 6 months ago #3244

indeed, a piece of code would be helpful.

And I suppose we have to add a stripslashes at some point too ?

NOT SOLVED - Re: unexpected T_STRING in cache.php 16 years, 6 months ago #3248

offending line of code found from putting in custom title tag:

here it is:

$metaTitles=array();
$metaTitles['charlotte/fan-mail']='Charlotte's Fan


I found this in my cache file. Indeed, It's the apostrophe that creates the error.<br><br>Post edited by: brewster44, at: 2007/10/17 17:42

Re: unexpected T_STRING in cache.php 16 years, 6 months ago #3257

  • cezo
  • OFFLINE
  • Posts: 4
By no means am I a professional programmer so this may not be the best approach, but it worked for me. Please use at your own discretion!! Maybe the site owners could intervene and give their input.

In “sef.cache.php” around line: 113
should look something like:
$str .= '$'.$arrayName.'[\''.$sef.'\']=\''. $val.'\';';


Replace with:
$str .= '$'.$arrayName.'[\''.$sef.'\']=\''.addslashes($val).'\';';


As I stated use at your own discretion!! But it works great for me. In essence all this does is get it to escape the single quotes which were used in some of my titles and content. At least that was my problem.

## So far I did NOT have to add stripslashes. ##

Re:Solved: unexpected T_STRING in cache.php 16 years, 6 months ago #3272

I have many error

Parse error: syntax error, unexpected T_STRING in /home.10.13/web-site/www/components/com_sef/cache/cache.php on line 10.

Parse error: syntax error, unexpected T_STRING in /home.10.13/web-site/www/components/com_sef/cache/cache.php on line 14

And I have to clean the cache whenever

Here is the file cache.php
 
 
10 - $hit=array();
 
14 - $metaTitles['music.php']='Web-site.com - Music';
 



What can I do ?<br><br>Post edited by: morpheusreims, at: 2007/10/23 12:30
  • Page:
  • 1
  • 2
User Login Empty