Stripslash modification working too well
-
Hello all,
I made a modification to my blog so that when apply markup and scripting to a pre box, stripslashes aren’t added to the quote marks with the pre. So, what I did is modify line 75 (last line of the “wp-autop” function) in the functions-formatting.php file located in the wp-includes directory. (version 1.5)
I replaced line 75 with this string:
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
Works great, but now it works too well in fact. If I insert stripslashes in the code I’m writing, it removes those as well, and it also coverted some quotes and apostrophes I made in a post this morning to their typographic counterparts.
I’m confused as to what to do. As it is I could convert back, but I’d have to replace the quotes with
"
, but as it is I have to add the stripslashes now, and this morning I also had to add in the quotes and apostrophes (to replace the typograhers quotes and apostrophes). So, in essence, something I have done to make less wortk for me is now making more work for me.Does anyone know how to get the functions to simply leave pre box content alone. No conversions at all. If stripshales are there leave them and if they’re not, don’t add them. The only thing I’d like to have to convert are angle brackets and nothing else. I don’t want to convert the angle brackets so I can still insert working markup within a pre block so I can add spans, etc, for formatting.
I hope this makes sense. In advance, thank you.
Sincerely,
Mike Cherim
- The topic ‘Stripslash modification working too well’ is closed to new replies.