Applied Adam Brunner's fix from bug 645982
authorJono X <jono@mozilla.com>
Thu, 31 Mar 2011 17:44:42 -0700
changeset 573 9392605bd674
parent 572 7dd6788c1500
child 574 011658f8822b
push id474
push userjdicarlo@mozilla.com
push date2011-04-01 00:44 +0000
bugs645982
Applied Adam Brunner's fix from bug 645982
extension/modules/feedback.js
extension/modules/tasks.js
--- a/extension/modules/feedback.js
+++ b/extension/modules/feedback.js
@@ -103,17 +103,17 @@ var FeedbackManager = {
      * in 'feedback', 'happy', or 'sad'.
      */
     let ioService = Cc["@mozilla.org/network/io-service;1"]
       .getService(Ci.nsIIOService);
     try {
       let uri = ioService.newURI(url, null, null);
       let path = uri.path;
       if (uri.host == "input.mozilla.com") {
-        if (path.indexOf("feedback" > -1) || path.indexOf("happy" > -1) || path.indexOf("sad" > -1)) {
+        if (path.indexOf("feedback") > -1 || path.indexOf("happy") > -1 || path.indexOf("sad") > -1) {
           return true;
         }
       }
     } catch(e) {
       /* newURI throws an exception if we try to parse urls like "about:config".  (Bug 644582)
        * Those are not the urls we're looking for anyway. */
       return false;
     }
--- a/extension/modules/tasks.js
+++ b/extension/modules/tasks.js
@@ -803,16 +803,17 @@ TestPilotExperiment.prototype = {
       json.metadata = md;
       json.metadata.task_guid = self.getGuid(self._id);
       json.metadata.event_headers = self._dataStore.getPropertyNames();
       let moreMd = self.getStudyMetadata();
       if (moreMd) {
         for (let i = 0; i < moreMd.length; i++) {
           if (moreMd[i].name && moreMd[i].value) {
             json.metadata[ moreMd[i].name ] = moreMd[i].value; // TODO sanitize strings?
+            // TODO handle case where name or value are something other than strings?
           }
         }
       }
       self._dataStore.getJSONRows(function(rows) {
         json.events = rows;
         self._dataStore.getExceptionsAsJson(function(errs) {
           json.exceptions = errs;
           callback( JSON.stringify(json) );