4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: comicart on September 13, 2006, 01:08:58 PM

Title: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 13, 2006, 01:08:58 PM
Since upgrading to 1.7.3 I see a problem with my Category descriptions.

If my description contains HTML, 4Images adds extra HTML tags!

For example - here is the description for one category:
Code: [Select]
<b>Fake Category Title</b><br>For more info visit the official website:<br><a href="http://fake_category.com/" target="_blank">http://fake_category.com/</a>
And here's how the code appears on the page:
Code: [Select]
<b>Fake Category Title</b><br>For more info visit the official website:<br><a href="http://fake_category.com/" target="_blank"><a href="http://fake_category.com/" target="_blank" rel="nofollow">http://fake_category.com/</a></a>
See how it *doubled* my a href link and closing "a" tag, plus added the "nofollow" to the link?

Is there a fix for this?
T
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: V@no on September 13, 2006, 02:35:19 PM
in includes/functions.php find:
Code: [Select]
    $text = replace_url($text);
Insert above:
Code: [Select]
    if (!$html)
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 13, 2006, 02:55:34 PM
Perfect! Thank you!

Terry
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 13, 2006, 03:04:55 PM
Any way to get rid of the extra line breaks that show when there is a "return" in the HTML?
I've found that my "pretty" HTML is getting extra line breaks from 4Images.

For example:
Code: [Select]
<p>Some Sample</p>
<ul>
<li type="circle">Item 1</li>
<li type="circle">Item 2</li>
</ul>

Becomes:
Code: [Select]
<p>Some Sample</p><br />
<ul><br />
<li type="circle">Item 1</li><br />
<li type="circle">Item 2</li><br />
</ul>

T
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: V@no on September 13, 2006, 03:24:19 PM
Ok, replace entire block:
Code: [Select]
  if ($html !== 2) {
    $text = nl2br(trim($text));
    $text = replace_url($text);
  }
With:
Code: [Select]
  if (!$html) {
    $text = nl2br(trim($text));
    $text = replace_url($text);
  }
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 13, 2006, 05:00:12 PM
*Perfect* - thanks!

T
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 14, 2006, 01:33:47 PM
One problem! :)

Doing this seems to have nixed the format of the Image Description on the Details pages also!

Can Categories and Image Description have different url and line break handling (like in earier versions)?

Terry
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: V@no on September 14, 2006, 02:31:45 PM
Ok, let me explain how it works.
If you want to use HTML you'll have to use <br> instead of newlines, there is no other way.
Title: Re: Extra HTML added to Category description. 1.7.3 Bug?
Post by: comicart on September 14, 2006, 02:41:29 PM
Ok, let me explain how it works.
If you want to use HTML you'll have to use <br> instead of newlines, there is no other way.

In 1.7 to 1.7.2 Categories and Image descriptions were handled differently.
I could put "pretty" HTML in the Category descriptions with no issues *and* use hard returns as breaks and simple URLs for links in the Description.

That's why I asked.

I guess that changed in 1.7.3?

Terry