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

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

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

Postby kakashka12345 » Tue Dec 28, 2010 12:06 pm

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 ?
kakashka12345
 
Posts: 10
Joined: Sun Dec 26, 2010 4:01 am

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

Postby kakashka12345 » Wed Dec 29, 2010 2:48 am

Ok, Bob suggested a solution in a different post:
viewtopic.php?f=2&t=1832#p9828

That worked.
kakashka12345
 
Posts: 10
Joined: Sun Dec 26, 2010 4:01 am

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

Postby hansfn » Wed Dec 29, 2010 9:14 am

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."
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

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

Postby Logfather » Sat Jan 21, 2012 8:34 am

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>");
    }
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

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

Postby hansfn » Sat Jan 21, 2012 5:58 pm

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.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

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

Postby Logfather » Sun Jan 22, 2012 3:44 pm

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.
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron