X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPage%2FRedirect.php;h=4f0b83dde4b60267b614c0890064518c8b989ea6;hb=b1c50c4224c2190871461e84bd63bef8e1da819c;hp=9883bfcd8504d10c623c4710b1a8a56434796c6b;hpb=17d83a01db1059f95af45e3bd8898e353e52c02c;p=civicrm-core.git diff --git a/CRM/Core/Page/Redirect.php b/CRM/Core/Page/Redirect.php index 9883bfcd85..4f0b83dde4 100644 --- a/CRM/Core/Page/Redirect.php +++ b/CRM/Core/Page/Redirect.php @@ -3,18 +3,24 @@ /** * Placeholder page which generates a redirect * - * @code + * ``` * * civicrm/admin/options/case_type * CRM_Core_Page_Redirect * url=civicrm/foo/bar?whiz=bang&passthru=%%passthru%% * - * @endcoe + * ``` */ class CRM_Core_Page_Redirect extends CRM_Core_Page { - public function run($path = NULL, $pageArgs = array()) { + + /** + * Run page. + * + * @param string $path + * @param array $pageArgs + */ + public function run($path = NULL, $pageArgs = []) { $url = self::createUrl($path, $_REQUEST, $pageArgs, TRUE); - // return $url; CRM_Utils_System::redirect($url); } @@ -32,10 +38,10 @@ class CRM_Core_Page_Redirect extends CRM_Core_Page { */ public static function createUrl($requestPath, $requestArgs, $pageArgs, $absolute) { if (empty($pageArgs['url'])) { - CRM_Core_Error::fatal('This page is configured as a redirect, but it does not have a target.'); + CRM_Core_Error::statusBounce(ts('This page is configured as a redirect, but it does not have a target.')); } - $vars = array(); + $vars = []; // note: %% isn't legal in a well-formed URL, so it's not a bad variable-delimiter foreach ($requestPath as $pathPos => $pathPart) { $vars["%%{$pathPos}%%"] = urlencode($pathPart); @@ -56,4 +62,5 @@ class CRM_Core_Page_Redirect extends CRM_Core_Page { return $url; } + }