From 78183bebf6805b30ece104cd697e1f6718364447 Mon Sep 17 00:00:00 2001 From: babelouest Date: Thu, 10 Apr 2014 13:51:52 -0400 Subject: [PATCH] fix scrutinizer errors --- js/otherbackendconfig.js | 20 ++++++++++---------- lib/dispatcher.php | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/js/otherbackendconfig.js b/js/otherbackendconfig.js index 5214c10f..3eec33f4 100644 --- a/js/otherbackendconfig.js +++ b/js/otherbackendconfig.js @@ -106,9 +106,9 @@ OC.Contacts = OC.Contacts || {}; var addressbook = OC.Contacts.addressBooks; var error=false; - var errorFields = new Array(); + var errorFields = []; $('[required]').each(function() { - if ($(this).val() == '' && !$(this).attr('disabled')){ + if ($(this).val() === '' && !$(this).attr('disabled')){ error = true; errorFields.push($(this).attr('placeholder')); } @@ -172,9 +172,9 @@ OC.Contacts = OC.Contacts || {}; var defer = $.Deferred(); var error=false; - var errorFields = new Array(); + var errorFields = []; $('[required]').each(function() { - if ($(this).val() == '' && !$(this).attr('disabled')){ + if ($(this).val() === '' && !$(this).attr('disabled')){ error = true; errorFields.push($(this).attr('placeholder')); } @@ -342,12 +342,12 @@ OC.Contacts = OC.Contacts || {}; // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY // home, end, period, and numpad decimal return ( - key == 8 || - key == 9 || - key == 13 || - key == 46 || - key == 110 || - key == 190 || + key === 8 || + key === 9 || + key === 13 || + key === 46 || + key === 110 || + key === 190 || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105)); diff --git a/lib/dispatcher.php b/lib/dispatcher.php index 63150278..fa7eba93 100644 --- a/lib/dispatcher.php +++ b/lib/dispatcher.php @@ -74,6 +74,7 @@ class Dispatcher extends MainApp { return new AddressBookController($this->appName, $request, $app); }); $this->container->registerService('BackendController', function(IAppContainer $container) use($app) { + $request = $container->query('Request'); return new BackendController($container, $request, $app); }); $this->container->registerService('GroupController', function(IAppContainer $container) use($app) {