FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » img bug introduced in most recent revision
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: img bug introduced in most recent revision [message #158626 is a reply to message #158624] Sun, 08 March 2009 19:59 Go to previous messageGo to previous message
Marticus
Messages: 272
Registered: June 2002
Karma:
Senior Member
To make it easier for everyone, combining your patch and my patch renders the following code:

--- post_proc.inc.t 2009-03-08 13:58:18.000000000 -0600
+++ post_proc.inc.t.new 2009-03-08 13:57:56.000000000 -0600
@@ -588,11 +588,11 @@
    ),
    $fudml);

-   while (preg_match('!<img src="(.*?)" border="0" alt="\\1">!is', $fudml)) {
-       $fudml = preg_replace('!<img src="(.*?)" border="0" alt="\\1">!is', '[img]\1[/img]', $fudml);
+   while (preg_match('!<img src="?(.*?)"? border="?0"? alt="\\1" ?/?>!is', $fudml)) {
+       $fudml = preg_replace('!<img src="?(.*?)"? border="?0"? alt="\\1" ?/?>!is', '[img]\1[/img]', $fudml);
    }
-   while (preg_match('!<img class="(r|l)" src="(.*?)" border="0" alt="\\2">!is', $fudml)) {
-       $fudml = preg_replace('!<img class="(r|l)" src="(.*?)" border="0" alt="\\2">!is', '[img\1]\2[/img\1]', $fudml);
+   while (preg_match('!<img class="(r|l)" src="(.*?)" border="?0"? alt="\\2" ?/?>!is', $fudml)) {
+       $fudml = preg_replace('!<img class="(r|l)" src="?(.*?)"? border="?0"? alt="\\2" ?/?>!is', '[img\1]\2[/img\1]', $fudml);
    }
    while (preg_match('!<a href="mailto:(.+?)" target="_blank">\\1</a>!is', $fudml)) {
        $fudml = preg_replace('!<a href="mailto:(.+?)" target="_blank">\\1</a>!is', '[email]\1[/email]', $fudml);
@@ -602,10 +602,10 @@
    }

    if (strpos($fudml, '<img src="') !== false) {
-       $fudml = preg_replace('!<img src="(.*?)" border="0" alt="(.*?)">!is', '[img=\1]\2[/img]', $fudml);
+       $fudml = preg_replace('!<img src="(.*?)" border="?0"? alt="(.*?)" ?/?>!is', '[img=\1]\2[/img]', $fudml);
    }
    if (strpos($fudml, '<img class="') !== false) {
-       $fudml = preg_replace('!<img class="(r|l)" src="(.*?)" border="0" alt="(.*?)">!is', '[img\1=\2]\3[/img\1]', $fudml);
+       $fudml = preg_replace('!<img class="(r|l)" src="(.*?)" border="?0"? alt="(.*?)" ?/?>!is', '[img\1=\2]\3[/img\1]', $fudml);
    }
    if (strpos($fudml, '<a href="mailto:') !== false) {
        $fudml = preg_replace('!<a href="mailto:(.+?)" target="_blank">(.+?)</a>!is', '[email=\1]\2[/email]', $fudml);
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: deleting attachments causes attachment list problem
Next Topic: Users missing in Group Manager
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 06:39:59 GMT 2024

Total time taken to generate the page: 0.04204 seconds