Author Topic: Extra HTML added to Category description. 1.7.3 Bug?  (Read 7005 times)

0 Members and 1 Guest are viewing this topic.

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Extra HTML added to Category description. 1.7.3 Bug?
« 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #1 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)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #2 on: September 13, 2006, 02:55:34 PM »
Perfect! Thank you!

Terry

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #3 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #4 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);
  }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #5 on: September 13, 2006, 05:00:12 PM »
*Perfect* - thanks!

T

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #6 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #7 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline comicart

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Extra HTML added to Category description. 1.7.3 Bug?
« Reply #8 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