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 #158624 is a reply to message #158623] Sun, 08 March 2009 19:52 Go to previous messageGo to previous message
Marticus
Messages: 272
Registered: June 2002
Karma:
Senior Member
Okay, I tested it and it works.

Two concerns. What does the ? do in the cases of ' ?/?>' and '"?' in the new code? Secondly, there is a new behavior. I think I resolved it by adding "? in the remainder of the border elements.

Let me explain.

The first preg_match replaces the xhtml code with \1, rendering the following response when you click on edit.

[img]index.php?t=getfile&id=492&private=0[/img]


The second preg_match replaces the xhtml code with \2, which renders the following response when you click on edit.

[img=index.php?t=getfile&id=492&private=0]index.php?t=getfile&id=492&private=0[/img]


Two patches ago, the code was causing the first preg_match to pass. Now, the code is causing the second preg_match to pass. I do not know if this change in behavior was intended. With the following patch, it now passes the first preg_match as before.

--- post_proc.inc.t.orig 2009-03-08 13:29:18.000000000 -0600
+++ post_proc.inc.t 2009-03-08 13:46:07.000000000 -0600
@@ -633,11 +633,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);
+       $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);
[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: Mon Nov 25 00:06:56 GMT 2024

Total time taken to generate the page: 0.04061 seconds