Tools :: redirect에서 이유를 발견했습니다. 그것은이 같은 라인이있다 : 여기
$url = Tools::strReplaceFirst('&', '?', $url);
들이 기본적으로 첫 번째 이외의 queryvar 제외됩니다, 그래서 당신은 몇 가지를 추가하면 당신은 어떤 찾을 수 없습니다. index.php?a=1&b=2
인 경우 index.php?a=1?b=2
이 표시됩니다. 나는 그 요점을 정말로 보지 않는다. 아마 그것은 버그 다.
그래서 무시 도구 : (modded하게 라인이 주석)과 같이 리디렉션 :
public static function redirect($url, $base_uri = __PS_BASE_URI__, Link $link = null, $headers = null){
if (!$link) $link = Context::getContext()->link;
$querystring = array_pop(explode('?', $url)); // MOD: Save the original querystring. I take the last item in array because sometimes (i think it's a bug) the $url is like index.php?controller=order.php?step=1, so 2 question marks.
if (strpos($url, 'http://') === false && strpos($url, 'https://') === false && $link) {
if (strpos($url, $base_uri) === 0) {
$url = substr($url, strlen($base_uri));
}
if (strpos($url, 'index.php?controller=') !== false && strpos($url, 'index.php/') == 0) {
$url = substr($url, strlen('index.php?controller='));
if (Configuration::get('PS_REWRITING_SETTINGS')) {
$url = Tools::strReplaceFirst('&', '?', $url); // ...Don't see the point here...
}
}
$explode = explode('?', $url);
// don't use ssl if url is home page
// used when logout for example
$use_ssl = !empty($url);
$url = $link->getPageLink($explode[0], $use_ssl);
if($querystring) $url .= '?'.$querystring; // MOD: adding full querystring!! Also deleted 3 lines that added $explode[1] instead
}
// Send additional headers
if ($headers) {
if (!is_array($headers)) $headers = array($headers);
foreach ($headers as $header) {
header($header);
}
}
header('Location: '.$url);
exit;
}
는 https://github.com/PrestaShop/PrestaShop/blob/1.6.1 당신 확인 [이] (인가 .x/controllers/front/AddressController.php # L243) 라인이 실행 중입니까? 그것이 아마 뭔가 다른 중간에 리다이렉션을하고있는 경우입니다. – TheDrot
예 실행 된 것 같아서 Tool :: redirect에서 실패한 이유를 찾았습니다. 재정의 코드를 작성하면 공식 답변을 게시 할 것입니다. – Stratboy