fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-03-29 12:59 pm

[dw-free] strip trailing spaces in sysban creation

[commit: http://hg.dwscoalition.org/dw-free/rev/6658a7b40621]

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

Strip leading and trailing spaces from the value before trying to sysban it
(first committed patch!)

Patch by [personal profile] randomling.

Files modified:
  • htdocs/admin/sysban.bml
--------------------------------------------------------------------------------
diff -r 7cfe01b86856 -r 6658a7b40621 htdocs/admin/sysban.bml
--- a/htdocs/admin/sysban.bml	Thu Mar 29 16:50:36 2012 +0800
+++ b/htdocs/admin/sysban.bml	Thu Mar 29 21:01:30 2012 +0800
@@ -264,7 +264,8 @@
         return $err->("Requires post") unless LJ::did_post();
         return $err->("Invalid form") unless LJ::check_form_auth();
 
-        my $value   = $POST{value};
+        # trim whitespace from both ends of the input before storing it in $value
+        my $value   = LJ::trim( $POST{value} );
         my $bandays = $POST{bandays};
         my $note    = $POST{note};
 
--------------------------------------------------------------------------------