[Pkg-mozext-commits] [greasemonkey] 01/35: GM_log truncates at NULL byte (typeof 'string' only)

David Prévot taffit at moszumanska.debian.org
Wed May 20 02:43:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 938591f81ef07670402b72e307cbed1fe6c13bbd
Author: janekptacijarabaci <janekptacijarabaci at users.noreply.github.com>
Date:   Thu Nov 6 07:59:54 2014 +0100

    GM_log truncates at NULL byte (typeof 'string' only)
---
 modules/miscapis.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/miscapis.js b/modules/miscapis.js
index 5cf4009..ebe1d94 100644
--- a/modules/miscapis.js
+++ b/modules/miscapis.js
@@ -244,7 +244,8 @@ GM_ScriptLogger.prototype.consoleService = Components
 
 GM_ScriptLogger.prototype.log = function(message) {
   // https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIConsoleService#logStringMessage() - wstring / wide string
-  message = message.replace(/\0/g, '');
+  if ('string' == typeof message || message instanceof String)
+    message = message.replace(/\0/g, '');
   this.consoleService.logStringMessage(this.prefix + '\n' + message);
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list