Re: img bug introduced in most recent revision [message #158592 is a reply to message #158589] |
Thu, 05 March 2009 10:51 |
|
naudefj
Messages: 3771 Registered: December 2004
Karma:
|
Senior Member Administrator Core Developer |
|
|
Hi Marticus,
The bug-rate is extremely low given the amount of changes introduced. However, I would be keen to know how "we" (as you've rightfully stated) can test every feature of such a large project more effectively. Maybe someone need to write a test-suite for us?
Anyway, here is a patch (I'm sure you could've prepared it yourself). However, I'm not going to commit it before "we" haven't tested it properly.
Index: post_proc.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/post_proc.inc.t,v
retrieving revision 1.99
diff -u -r1.99 post_proc.inc.t
--- post_proc.inc.t 22 Feb 2009 00:00:37 -0000 1.99
+++ post_proc.inc.t 5 Mar 2009 10:49:33 -0000
@@ -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);
Best regards.
Frank
|
|
|