Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
content filters and page slugs
#4
(2012-05-16, 06:28:13)mvlcek Wrote: The content filter is available to filter the content of pages and replace parts or do some other processing.
If a plugin wants to replace the page content completely, it should rather do this in index-pretemplate:
...

I've found that if you use index-pretemplate instead of the content filter to replace a page's content, the $content variable must be prepared (encoded, slashed) so that GS can process it properly -- if not, a page having &lt; in the body will be broken or not rendered as expected, as it is decoded to <

Would this be the correct way to fix this?
Code:
$content = addslashes(htmlspecialchars($content, ENT_NOQUOTES, 'UTF-8'));

BTW @shawn_a - GS Blog seems to have this problem.
Reply


Messages In This Thread
content filters and page slugs - by shawn_a - 2012-05-16, 04:41:52
RE: content filters and page slugs - by shawn_a - 2013-04-30, 01:19:36
content filters and page slugs - by mvlcek - 2012-05-16, 06:28:13
RE: content filters and page slugs - by Carlos - 2013-04-30, 01:07:51
content filters and page slugs - by shawn_a - 2012-06-01, 04:45:57



Users browsing this thread: 1 Guest(s)