projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #12201 from seamuslee001/report_activity_117
[civicrm-core.git]
/
CRM
/
Utils
/
System.php
diff --git
a/CRM/Utils/System.php
b/CRM/Utils/System.php
index d316eaf9d1f9e2971ef79e4b5dcc6995851250b8..e2d72f5303244d9eb8c031c82696994bedd3f47f 100644
(file)
--- a/
CRM/Utils/System.php
+++ b/
CRM/Utils/System.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version
4.7
|
+ | CiviCRM version
5
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
@@
-433,8
+433,10
@@
class CRM_Utils_System {
*
* @param string $url
* The URL to provide to the browser via the Location header.
*
* @param string $url
* The URL to provide to the browser via the Location header.
+ * @param array $context
+ * Optional additional information for the hook.
*/
*/
- public static function redirect($url = NULL) {
+ public static function redirect($url = NULL
, $context = []
) {
if (!$url) {
$url = self::url('civicrm/dashboard', 'reset=1');
}
if (!$url) {
$url = self::url('civicrm/dashboard', 'reset=1');
}
@@
-442,8
+444,14
@@
class CRM_Utils_System {
// this is kinda hackish but not sure how to do it right
$url = str_replace('&', '&', $url);
// this is kinda hackish but not sure how to do it right
$url = str_replace('&', '&', $url);
+ $context['output'] = CRM_Utils_Array::value('snippet', $_GET);
+
+ $parsedUrl = CRM_Utils_Url::parseUrl($url);
+ CRM_Utils_Hook::alterRedirect($parsedUrl, $context);
+ $url = CRM_Utils_Url::unparseUrl($parsedUrl);
+
// If we are in a json context, respond appropriately
// If we are in a json context, respond appropriately
- if (
CRM_Utils_Array::value('snippet', $_GET)
=== 'json') {
+ if (
$context['output']
=== 'json') {
CRM_Core_Page_AJAX::returnJsonResponse(array(
'status' => 'redirect',
'userContext' => $url,
CRM_Core_Page_AJAX::returnJsonResponse(array(
'status' => 'redirect',
'userContext' => $url,