UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

Sponsored Links

+- Recent Posts

Re: German Language files by Tony_R
Today at 07:49:36 am

Re: German Language files by Tony_R
May 15, 2012, 02:09:12 pm

Re: German Language files by EzPortal
May 15, 2012, 02:00:02 pm

Re: German Language files by Tony_R
May 15, 2012, 01:55:26 pm

Re: German Language files by EzPortal
May 15, 2012, 01:38:52 pm

Re: German Language files by Tony_R
May 15, 2012, 01:29:19 pm

Re: German Language files by Tony_R
May 15, 2012, 09:44:14 am

Re: German Language files by Tony_R
May 15, 2012, 08:34:06 am

Re: German Language files by EzPortal
May 15, 2012, 07:27:30 am

Cache Error ? by Tony_R
May 15, 2012, 05:01:37 am

Quick Menu

Announcements
Community Guidelines & Rules
How To Section
EzPortal Showcase
Support

Author Topic: Corruption of PHP block data  (Read 1718 times)

0 Members and 1 Guest are viewing this topic.

Offline JohnR

  • Posts: 10
  • Karma: 0
    • View Profile
Corruption of PHP block data
« on: July 04, 2011, 08:05:24 am »
When creating a new PHP EzBlock in the editor the block won't then run without a syntax error if it contains any backslashes (in and escaped string for example).  The reason appears to be that the block data is saved without properly escaping backslashes.   Retrieved block data has the backslashes stripped by MySQL as it thinks they are SQL escape characters (in other words it removes all backslashes from the original code).

One fix is to use $smcFunc['db_escape_string'] on the blockdata before saving it.  Alternatively use the SMF2 $smcFunc['db_insert'] and $smcFunc['db_replace'] to save the data correctly (they escape it properly before saving).

 

Powered by EzPortal