Index: admin_templates/incs/close_popup.tpl =================================================================== --- admin_templates/incs/close_popup.tpl (revision 14888) +++ admin_templates/incs/close_popup.tpl (working copy) @@ -12,7 +12,7 @@ var $modal_windows = truefalse; if ($is_debug) { - document.write('' + $redirect_url.replace('%5C', '\\') + ''); + document.write('' + $redirect_url.replace(/%5C/g, '\\') + ''); } else { proceed_redirect(); @@ -43,7 +43,7 @@ } else if (!$use_popups) { // not using popups (for editing), but close_popup called (e.g. from selector) - window.location.href = $redirect_url.replace('%5C', '\\'); + window.location.href = $redirect_url.replace(/%5C/g, '\\'); } } Index: admin_templates/js/script.js =================================================================== --- admin_templates/js/script.js (revision 14888) +++ admin_templates/js/script.js (working copy) @@ -1817,7 +1817,7 @@ // setTimeout allows to call method indirectly. Without it whole idea won't work 2nd time (try adding 2 relations one after another) setTimeout( function() { - openSelector('adm', $ru.replace('%5C', '\\') + '&merge_opener_stack=1'); + openSelector('adm', $ru.replace(/%5C/g, '\\') + '&merge_opener_stack=1'); }, 200 ); @@ -1828,7 +1828,7 @@ window.focus(); if ( !(($force_skip_refresh === true) || (typeof $skip_refresh != 'undefined' && $skip_refresh)) ) { - window.location.href = $redirect_url.replace('%5C', '\\'); + window.location.href = $redirect_url.replace(/%5C/g, '\\'); } } Index: kernel/utility/opener_stack.php =================================================================== --- kernel/utility/opener_stack.php (revision 14888) +++ kernel/utility/opener_stack.php (working copy) @@ -130,12 +130,14 @@ return $this->data[$index]; } - list ($index_file, $env) = explode('|', $this->data[$index], 2); - $params = $this->Application->processQueryString($env, 'pass'); + list ($index_file, $original_env) = explode('|', $this->data[$index], 2); + $fixed_env = str_replace(Array ('&', '%5C'), Array ('&', '\\'), $original_env); + $params = $this->Application->processQueryString($fixed_env, 'pass'); + // detect "__URLENCODE__" parameter value, used when opener stack element was built // without it rebuilding opener stack element will convert all "&" to "&" elements - $params['__URLENCODE__'] = (strpos($env, '&') !== false && strpos($env, '&') === false) || (strpos($env, '\\') !== false && strpos($env, '%5C') === false) ? 1 : 0; + $params['__URLENCODE__'] = $original_env != $fixed_env ? 1 : 0; $template = kUtil::popParam('t', $params, '');