shazahm1 / WP-Syntax

WP-Syntax WordPress Plugin
connections-pro.com
GNU General Public License v2.0
13 stars 11 forks source link

Slashes don't escape properly #19

Closed Flynsarmy closed 7 years ago

Flynsarmy commented 9 years ago

I have the following code

<pre lang="bash" line="1">rename "s/ ([a-z])/ \U\1\E/g" *.mkv</pre>

and on first page load it will show correctly as s/ ([a-z])/ \U\1\E/g" *.mkv however on second page load it shows as s/ ([a-z])/ U1E/g" *.mkv - notice the \ characters are now missing.. It appears this has something to do with the caching - I'm guessing the cache is loaded then the string is escaped again.

shazahm1 commented 7 years ago

Actually the slashed are being stripped when saved into the postmeta cache.

shazahm1 commented 7 years ago

Using wp_slash() highlighted post content when updating the postmeta resolves this.

shazahm1 commented 7 years ago

Fixed in 11a7d96d12ade00c8281b7a6bad98dcc41a94eeb.