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 , 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 , 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);