X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FREST.php;h=c9a8b93570f01c06097975fab27fac49675b0d22;hb=f17ea5d9ab05d5c41d9d9dd1a30d73fcef0e4938;hp=52e7e5296484fcd5e05c915bbeea2041b6ead058;hpb=a6491ceec03e64e45e127222ae268187c652f5b7;p=civicrm-core.git diff --git a/CRM/Utils/REST.php b/CRM/Utils/REST.php index 52e7e52964..c9a8b93570 100644 --- a/CRM/Utils/REST.php +++ b/CRM/Utils/REST.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2019 | + | Copyright CiviCRM LLC (c) 2004-2020 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -29,17 +29,19 @@ * This class handles all REST client requests. * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2019 + * @copyright CiviCRM LLC (c) 2004-2020 */ class CRM_Utils_REST { /** * Number of seconds we should let a REST process idle + * @var int */ - static $rest_timeout = 0; + public static $rest_timeout = 0; /** * Cache the actual UF Class + * @var string */ public $ufClass; @@ -399,8 +401,10 @@ class CRM_Utils_REST { CRM_Utils_System::setHttpHeader("Status", "404 Not Found"); die("Can't find the requested template file templates/$tpl"); } - if (array_key_exists('id', $_GET)) {// special treatmenent, because it's often used - $smarty->assign('id', (int) $_GET['id']);// an id is always positive + // special treatmenent, because it's often used + if (array_key_exists('id', $_GET)) { + // an id is always positive + $smarty->assign('id', (int) $_GET['id']); } $pos = strpos(implode(array_keys($_GET)), '<'); @@ -480,7 +484,8 @@ class CRM_Utils_REST { $params['check_permissions'] = TRUE; $params['version'] = 3; - $_GET['json'] = $requestParams['json'] = 1; // $requestParams is local-only; this line seems pointless unless there's a side-effect influencing other functions + // $requestParams is local-only; this line seems pointless unless there's a side-effect influencing other functions + $_GET['json'] = $requestParams['json'] = 1; if (!$params['sequential']) { $params['sequential'] = 1; } @@ -597,7 +602,8 @@ class CRM_Utils_REST { if (!empty($q)) { if (count($args) == 2 && $args[1] == 'ping') { CRM_Utils_System::loadBootStrap([], FALSE, FALSE); - return NULL; // this is pretty wonky but maybe there's some reason I can't see + // this is pretty wonky but maybe there's some reason I can't see + return NULL; } if (count($args) != 3) { return self::error('ERROR: Malformed REST path');