Parse error: syntax error, unexpected T_STRING

Found a bug? Tell us!!
Post Reply
fyremoon
Posts: 2
Joined: Sat Dec 20, 2008 2:07 pm

Parse error: syntax error, unexpected T_STRING

Post by fyremoon »

Hello,

I've just updated my PHP from 5.2 to 5.3.2 and got the following error:
Parse error: syntax error, unexpected T_STRING in /home/serendipity/include/functions_entries.inc.php on line 1433

On line 1433, the DELETE FROM lines have double quotes on four lines for $serendipity["dbPrefix"] where they should be $serendipity['dbPrefix']
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}entries WHERE i
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}entrycat WHERE
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}entryproperties
serendipity_db_query("DELETE FROM {$serendipity["dbPrefix"]}comments WHERE
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHER
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}permalinks WHER

Oddly enough, this wasn't noticed by PHP 5.2

This is using serendipity 1.5.3 (tar.gz) from this website.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Parse error: syntax error, unexpected T_STRING

Post by garvinhicking »

Hi!

Thanks a lot! I wasn't aware of this, I'm also curious why this worked in earlier versions. I patched it as per your suggestion (simply change ["dbprefix"] to ['dbprefix']) and it surely works fine. I'll see to come up with a new release for this and meanwhile announce it on the blog.

Thanks,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Parse error: syntax error, unexpected T_STRING

Post by Don Chambers »

Odd.... I never encountered this problem in php 5.3.0 either.
=Don=
Post Reply