Make sure text argument is treated as a string.
Patch by exor674.
diffs (20 lines):
diff -r 1440b080e8c1 -r 522fd8d99d0c cgi-bin/ljtextutil.pl
--- a/cgi-bin/ljtextutil.pl Wed Nov 24 10:19:22 2010 -0600
+++ b/cgi-bin/ljtextutil.pl Thu Nov 25 20:24:38 2010 -0600
@@ -288,11 +288,13 @@ sub is_utf8 {
# returns: 1 if text is a valid UTF-8 stream, a reference, or null; 0
otherwise.
# </LJFUNC>
sub is_utf8_wrapper {
- my $text = shift;
+ my $text = $_[0];
- if ( defined $text && ! ref $text ) {
- return Unicode::CheckUTF8::is_utf8( $text );
+ if ( defined $text && ! ref $text && $text ) {
+ # we need to make sure $text values are treated as strings
+ return Unicode::CheckUTF8::is_utf8( '' . $text );
} else {
+ # all possible "false" values for $text are valid unicode
return 1;
}
}
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog