Fix malformed redirect URLs
authorChristian Wach <needle@haystack.co.uk>
Fri, 19 Oct 2018 13:44:05 +0000 (14:44 +0100)
committerChristian Wach <needle@haystack.co.uk>
Fri, 19 Oct 2018 13:44:05 +0000 (14:44 +0100)
CRM/Core/QuickForm/Action/Jump.php

index fa8e4db71fb6794e6b6c5d0fc52a6603c4964d02..20dc0d6f5ac4662aa09f3fd66d701015aa0e451d 100644 (file)
@@ -74,6 +74,9 @@ class CRM_Core_QuickForm_Action_Jump extends CRM_Core_QuickForm_Action {
     }
     // generate the URL for the page 'display' event and redirect to it
     $action = $current->getAttribute('action');
+    // prevent URLs that end in ? from causing redirects
+    $action = rtrim($action, '?');
+    // FIXME: this should be passed through CRM_Utils_System::url()
     $url = $action . (FALSE === strpos($action, '?') ? '?' : '&') . $current->getButtonName('display') . '=true' . '&qfKey=' . $page->get('qfKey');
 
     CRM_Utils_System::redirect($url);