summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuriy Gerasimov2013-06-21 14:36:57 (GMT)
committer Yuriy Gerasimov2013-06-21 14:36:57 (GMT)
commit580e83d8f0983bf4d4db874f3dcf8d440974f8e1 (patch)
treece1657eb1c6794f4ff66b82fbfedca436cee254b
parent04ce1bbefddfcef4929015fa5a62751b8148f8b0 (diff)
Issue #1986008 by h3rj4n, Jerenus: Check on settings with !empty() instead of isset().
-rw-r--r--auth/services_oauth/services_oauth.inc3
-rw-r--r--includes/services.runtime.inc2
2 files changed, 3 insertions, 2 deletions
diff --git a/auth/services_oauth/services_oauth.inc b/auth/services_oauth/services_oauth.inc
index 68b90ca..342bcda 100644
--- a/auth/services_oauth/services_oauth.inc
+++ b/auth/services_oauth/services_oauth.inc
@@ -19,7 +19,8 @@
*/
function _services_oauth_authenticate_call($settings, $method, $args) {
$endpoint = array();
- if (isset($method['endpoint']['services_oauth'])) {
+ // Grep the specific settings for this method
+ if (!empty($method['endpoint']['services_oauth']['credentials'])) {
$endpoint += array_filter($method['endpoint']['services_oauth']);
}
$endpoint += $settings;
diff --git a/includes/services.runtime.inc b/includes/services.runtime.inc
index 3ac1776..9cdf864 100644
--- a/includes/services.runtime.inc
+++ b/includes/services.runtime.inc
@@ -411,7 +411,7 @@ function _services_access_value($data, $fields) {
function _services_authenticate_user($controller, $endpoint, $args, $options) {
if (!isset($options['skip_authentication']) || !$options['skip_authentication']) {
foreach ($endpoint->authentication as $auth_module => $auth_settings) {
- if (isset($auth_settings) && $auth_error = services_auth_invoke($auth_module, 'authenticate_call', $auth_settings, $controller, $args)) {
+ if (!empty($auth_settings) && $auth_error = services_auth_invoke($auth_module, 'authenticate_call', $auth_settings, $controller, $args)) {
return services_error($auth_error, 401);
}
}