From 999427e9856ed76670844a1b3339a13e0fedcc58 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 13 Jul 2012 10:08:10 +0800 Subject: [PATCH] MDL-34240 - google plugins: switch to PARAM_RAW_TRIMMED This ensures the client credentials which are entered are trimmed as users are finding problems with bad pastes. --- portfolio/googledocs/lib.php | 2 ++ portfolio/picasa/lib.php | 2 ++ repository/googledocs/lib.php | 2 ++ repository/picasa/lib.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/portfolio/googledocs/lib.php b/portfolio/googledocs/lib.php index 0405ba5b79f30..a7b87d06a4f60 100644 --- a/portfolio/googledocs/lib.php +++ b/portfolio/googledocs/lib.php @@ -108,7 +108,9 @@ public static function admin_config_form(&$mform) { $mform->addElement('static', null, '', get_string('oauthinfo', 'portfolio_googledocs', $a)); $mform->addElement('text', 'clientid', get_string('clientid', 'portfolio_googledocs')); + $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret', get_string('secret', 'portfolio_googledocs')); + $mform->setType('secret', PARAM_RAW_TRIMMED); $strrequired = get_string('required'); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); diff --git a/portfolio/picasa/lib.php b/portfolio/picasa/lib.php index cbef42c2a8f87..fff8760f01bb6 100644 --- a/portfolio/picasa/lib.php +++ b/portfolio/picasa/lib.php @@ -108,7 +108,9 @@ public static function admin_config_form(&$mform) { $mform->addElement('static', null, '', get_string('oauthinfo', 'portfolio_picasa', $a)); $mform->addElement('text', 'clientid', get_string('clientid', 'portfolio_picasa')); + $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret', get_string('secret', 'portfolio_picasa')); + $mform->setType('secret', PARAM_RAW_TRIMMED); $strrequired = get_string('required'); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); diff --git a/repository/googledocs/lib.php b/repository/googledocs/lib.php index ee56c02871afd..c3a00e1a628a9 100644 --- a/repository/googledocs/lib.php +++ b/repository/googledocs/lib.php @@ -119,7 +119,9 @@ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_googledocs')); + $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret', get_string('secret', 'repository_googledocs')); + $mform->setType('secret', PARAM_RAW_TRIMMED); $strrequired = get_string('required'); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); diff --git a/repository/picasa/lib.php b/repository/picasa/lib.php index 7dbdf7b71369a..10a78e7bd7c25 100644 --- a/repository/picasa/lib.php +++ b/repository/picasa/lib.php @@ -121,7 +121,9 @@ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_picasa')); + $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret', get_string('secret', 'repository_picasa')); + $mform->setType('secret', PARAM_RAW_TRIMMED); $strrequired = get_string('required'); $mform->addRule('clientid', $strrequired, 'required', null, 'client');