Page 1 of 1

In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Tue Dec 28, 2010 12:06 pm
by kakashka12345
I have used [[introduction strip=1]] in my meta description tag. The problem is that my introduction contained one [[tt]] tag. So as a result I got the following:

Code: Select all
<meta name="description" content="bla bla bla <a rel='tag' class='pivotx-taglink' href='/tag/some+tag' title='Entries tagged with: some+tag'>some tag</...">


It means that the following code in module_parser.php did not pick it up:
Code: Select all
 if ($strip!=false) {
        $output = strip_tags($output,"<a><b><i><u><strong><em>");
    }


or the [[tt]] tag was applied after the HTML tags were stripped from introduction ?

Re: In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Wed Dec 29, 2010 2:48 am
by kakashka12345
Ok, Bob suggested a solution in a different post:
viewtopic.php?f=2&t=1832#p9828

That worked.

Re: In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Wed Dec 29, 2010 9:14 am
by hansfn
Just for the record - your analysis is wrong. The code you pointed to in module_parser.php strips all tags except the ones listed in the call to strip_tags. That explains why the output generated by the [[tt]] isn't stripped down.

PS! This behavior of the strip parameter is documented: "If strip is set to 1, most HTML tags are removed from the output."

Re: In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Sat Jan 21, 2012 8:34 am
by Logfather
How would you people go about stripping " as in &quot;?
Tried several ways (single ' and backlash etc.) but to no avail. Currently [[ title ]] gives some trouble with Twitter and Facebook buttons because of this reason. Only when you have &quot; in a title of course.

Code: Select all
if ($strip!=false) {
        $output = strip_tags($output,"<a><b><i><u><strong><em>");
    }

Re: In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Sat Jan 21, 2012 5:58 pm
by hansfn
What exactly is the problem - the double quote itself or that it is converted to "&quot;". You could use
[[ $title|strip_tags ]] instead of [[ title ]] to avoid the conversion.

Re: In [[introduction]] , the HTML tags remain when strip=1

PostPosted: Sun Jan 22, 2012 3:44 pm
by Logfather
No, the problem is not that it converts to &quot;. The problem is using that sign (quotes) in a title and than having that title with those quotes as a meta tag. HTML no likey.