Refactor to be more readable.

        Patch by kareila. 

diffs (23 lines):

diff -r d37e371fa48c -r 9135a526692e cgi-bin/LJ/CleanHTML.pm
--- a/cgi-bin/LJ/CleanHTML.pm   Fri Feb 11 22:14:43 2011 +0000
+++ b/cgi-bin/LJ/CleanHTML.pm   Mon Feb 07 16:47:39 2011 +0800
@@ -764,9 +764,16 @@ sub clean
                     }
 
                     # remove specific attributes
-                    if (($remove_colors && ($attr eq "color" || $attr eq 
"bgcolor" || $attr eq "fgcolor" || $attr eq "text")) ||
-                        ($remove_sizes && $attr eq "size") ||
-                        ($remove_fonts && $attr eq "face")) {
+                    my %remove_attrs =
+                        ( color   => $remove_colors,
+                          bgcolor => $remove_colors,
+                          fgcolor => $remove_colors,
+                          text    => $remove_colors,
+                          size    => $remove_sizes,
+                          face    => $remove_fonts,
+                        );
+
+                    if ( $remove_attrs{$attr} ) {
                         delete $hash->{$attr};
                         next ATTR;
                     }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to