fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-04-29 06:33 am

[dw-free] %%url%% only substituted once in crossposting footer preview

[commit: http://hg.dwscoalition.org/dw-free/rev/5b3ad1484f48]

http://bugs.dwscoalition.org/show_bug.cgi?id=2554

Fix the preview for the crossposting footer, when there multiple instances
of special variables (e.g., two %%url%%); the actual footer already works
as expected.

Patch by [personal profile] allen.

Files modified:
  • cgi-bin/DW/Setting/XPostAccounts.pm
--------------------------------------------------------------------------------
diff -r 4d08c1afa86e -r 5b3ad1484f48 cgi-bin/DW/Setting/XPostAccounts.pm
--- a/cgi-bin/DW/Setting/XPostAccounts.pm	Wed Apr 28 23:26:14 2010 -0700
+++ b/cgi-bin/DW/Setting/XPostAccounts.pm	Wed Apr 28 23:38:15 2010 -0700
@@ -171,10 +171,10 @@ sub option {
           previewString = previewString.replace(/\\r/g, "");
           previewString = previewString.replace(/\\n/g, "\\r\\n");
           previewString = substrUtf(previewString, $footer_length);
-          previewString = previewString.replace(/%%url%%/, '$baseurl/12345.html');
-          previewString = previewString.replace(/%%reply_url%%/, '$baseurl/12345.html?mode=reply');
-          previewString = previewString.replace(/%%comment_url%%/, '$baseurl/12345.html#comments');
-          previewString = previewString.replace(/%%comment_image%%/, '<img src="$baseurl/tools/commentcount?samplecount=23" width="30" height="12" alt="$alttext" style="vertical-align: middle;"/>');
+          previewString = previewString.replace(/%%url%%/gi, '$baseurl/12345.html');
+          previewString = previewString.replace(/%%reply_url%%/gi, '$baseurl/12345.html?mode=reply');
+          previewString = previewString.replace(/%%comment_url%%/gi, '$baseurl/12345.html#comments');
+          previewString = previewString.replace(/%%comment_image%%/gi, '<img src="$baseurl/tools/commentcount?samplecount=23" width="30" height="12" alt="$alttext" style="vertical-align: middle;"/>');
           \$('footer_preview').innerHTML = previewString;
         }
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org