Remove HTML from updates email
authorJamie Cameron <jcameron@webmin.com>
Wed, 18 Jun 2008 14:12:53 +0000 (14:12 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 18 Jun 2008 14:12:53 +0000 (14:12 +0000)
usermin/update.pl
web-lib-funcs.pl
webmin/update.pl

index eed9c76..f5e5a0a 100755 (executable)
@@ -93,6 +93,7 @@ foreach $u (@updates) {
                else {
                        $irv = &install_usermin_module($mtemp, 1, 0);
                        if (!ref($irv)) {
+                               $irv =~ s/<[^>]*>//g;
                                $irv .= &text('update_failed', $irv)."\n\n";
                                }
                        else {
index 681348d..34f7339 100755 (executable)
@@ -2932,6 +2932,8 @@ else {
 }
 
 # text(message, [substitute]+)
+# Returns a translated message from %text, but with $1, $2, etc.. replaced with the
+# substitute parameters.
 sub text
 {
 local $rv = $text{$_[0]};
index 16950ad..23366c5 100755 (executable)
@@ -55,7 +55,7 @@ foreach $url (@urls) {
                               $u->[4]."\n\n";
                        }
                else {
-                       # Actually do the update .. XXX remove html from comments
+                       # Actually do the update ..
                        local (@mdescs, @mdirs, @msizes);
                        $rv .= &text('update_mok', $u->[0], $u->[1])."\n".
                               ($info{'longdesc'} ? "$text{'update_fixes'} : " : "").
@@ -75,6 +75,7 @@ foreach $url (@urls) {
                                $irv = &install_webmin_module($mtemp, 1, 0,
                                                              [ "admin", "root" ]);
                                if (!ref($irv)) {
+                                       $irv =~ s/<[^>]*>//g;
                                        $rv .= &text('update_failed', $irv)."\n\n";
                                        }
                                else {