Index: trunk/core/kernel/application.php =================================================================== diff -u -r5002 -r5018 --- trunk/core/kernel/application.php (.../application.php) (revision 5002) +++ trunk/core/kernel/application.php (.../application.php) (revision 5018) @@ -1318,6 +1318,7 @@ if (!isset($params['pass'])) $params['pass'] = 'all'; $params['__URLENCODE__'] = 1; $location = $this->HREF($t, $prefix, $params, $index_file); + $a_location = $location; $location = "Location: $location"; //echo " location : $location
"; @@ -1335,10 +1336,16 @@ return true; } else { - if (headers_sent() != '') { - echo ''; + if ($this->GetVar('ajax') == 'yes' && $t != $this->GetVar('t')) { + // redirection to other then current template during ajax request + echo '#redirect#'.$a_location; } + elseif (headers_sent() != '') { + // some output occured -> redirect using javascript + echo ''; + } else { + // no output before -> redirect using HTTP header header("$location"); } }