mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-08-07 03:42 pm

[dw-free] Fix error log message:

[commit: http://hg.dwscoalition.org/dw-free/rev/255031e8e79e]

Fix error log message:

value for memkey:embedcont:221015:180 is not defined at /home/dw/current
/cgi-bin/Cache/Memcached.pm line 476

Turns out, the HTML cleaner has a bogus mode where if you pass it an empty
string or something that entirely gets stripped, it returns undef. This
causes a problem later when Cache::Memcached tries to store it.

Patch by [staff profile] mark.

Files modified:
  • cgi-bin/cleanhtml.pl
--------------------------------------------------------------------------------
diff -r 7ae5063f002e -r 255031e8e79e cgi-bin/cleanhtml.pl
--- a/cgi-bin/cleanhtml.pl	Fri Aug 07 09:42:53 2009 -0500
+++ b/cgi-bin/cleanhtml.pl	Fri Aug 07 15:42:52 2009 +0000
@@ -97,8 +97,13 @@ sub clean
 sub clean
 {
     my $data = shift;
+    return undef unless defined $$data;
+
     my $opts = shift;
-    my $newdata;
+
+    # this has to be an empty string because otherwise we might never actually append
+    # anything to it if $$data contains only invalid content
+    my $newdata = '';
 
     # remove the auth portion of any see_request.bml links
     $$data =~ s/(see_request\.bml\S+?)auth=\w+/$1/ig;
--------------------------------------------------------------------------------

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