]> git.donarmstrong.com Git - infobot.git/blobdiff - src/logger.pl
* Security patch for binmode UTF8 handling for CVE-2007-5116
[infobot.git] / src / logger.pl
index 5a8fd1a893c3db31de7e3053a4f9ecddfb531bea..8309a14fa3f6817fb589eebc0c10472debcd88e9 100644 (file)
@@ -97,7 +97,7 @@ sub openLog {
     }
 
     if (open(LOG, ">>$file{log}")) {
-       binmode(LOG, ":utf8");
+       binmode(LOG, ":encoding(UTF-8)");
        &status("Opened logfile $file{log}.");
        LOG->autoflush(1);
     } else {
@@ -376,11 +376,11 @@ sub debug_perl {
        &status("WARN: cannot open $file: $!");
        return;
     }
-    binmode(IN, ":utf8");
+    binmode(IN, ":encoding(UTF-8)");
 
     # TODO: better filename.
     open(OUT, ">>debug.log");
-    binmode(OUT, ":utf8");
+    binmode(OUT, ":encoding(UTF-8)");
     print OUT "DEBUG: $str\n";
 
     # note: cannot call external functions because SIG{} does not allow us to.
@@ -415,7 +415,7 @@ sub openSQLDebug {
        delete $param{'SQLDebug'};
        return 0;
     }
-    binmode(SQLDEBUG, ":utf8");
+    binmode(SQLDEBUG, ":encoding(UTF-8)");
 
     &status("Opened SQL Debug file: $param{'SQLDebug'}");
     return 1;