Merge pull request #21438 from colemanw/fixApi4GetDefaults
[civicrm-core.git] / CRM / Core / Controller.php
index 4a4254c25505eab19aecbaf5105742fe943f76cc..0a5f6482e8d55de2a45cfeb42d9cebbe9e697994 100644 (file)
@@ -241,6 +241,11 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
       // in this case we'll also cache the url as a hidden form variable, this allows us to
       // redirect in case the session has disappeared on us
       $this->_entryURL = CRM_Utils_System::makeURL(NULL, TRUE, FALSE, NULL, TRUE);
+      // In WordPress Shortcodes the standard entryURL generated via makeURL doesn't generally have id=x&reset=1 included so we add them here
+      // This prevents infinite loops caused when the session has timed out.
+      if (stripos($this->_entryURL, 'id') === FALSE && (stripos($this->_entryURL, 'transact') !== FALSE || stripos($this->_entryURL, 'register') !== FALSE)) {
+        $this->_entryURL .= '&id=' . CRM_Utils_Request::retrieveValue('id', 'Positive') . '&reset=1';
+      }
       $this->set('entryURL', $this->_entryURL);
     }
 
@@ -568,8 +573,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   public function addWizardStyle(&$wizard) {
     $wizard['style'] = [
       'barClass' => '',
-      'stepPrefixCurrent' => '<i class="crm-i fa-chevron-right" aria-hidden="true"></i>&nbsp;',
-      'stepPrefixPast' => '<i class="crm-i fa-check" aria-hidden="true"></i>&nbsp;',
+      'stepPrefixCurrent' => '<i class="crm-i fa-chevron-right" aria-hidden="true"></i> ',
+      'stepPrefixPast' => '<i class="crm-i fa-check" aria-hidden="true"></i> ',
       'stepPrefixFuture' => ' ',
       'subStepPrefixCurrent' => '&nbsp;&nbsp;',
       'subStepPrefixPast' => '&nbsp;&nbsp;',