Quote from: OpenGeek at Jan 15, 2006, 06:50 PM
If not, do you know what code change made the difference?
Jason,
I don’t think it’s a bug, I just seem to have got an old copy of the file. The first install was done about December 30th and the second around Jan 15th. However, in case it’s of any use to anyone else the difference between the files was as follows.
Old file:
// redirect
if($_REQUEST["refurl"]) {
// last accessed page
$url = $_REQUEST["refurl"];
$modx->sendRedirect($url,0,REDIRECT_REFRESH);
}
else {
// login home page
$url = $modx->makeURL($id);
$modx->sendRedirect($url);
}
New file:
// redirect
if(isset($_REQUEST['refurl']) && !empty($_REQUEST['refurl'])) {
// last accessed page
$targetPageId= html_entity_decode($_REQUEST['refurl']);
if (strpos($targetPageId, 'q=') !== false) {
$urlPos = strpos($targetPageId, 'q=')+2;
$alias = substr($targetPageId, $urlPos);
$aliasLength = (strpos($alias, '&'))? strpos($alias, '&'): strlen($alias);
$alias = substr($alias, 0, $aliasLength);
$url = $modx->config['base_url'] . $alias;
} elseif ($targetPageId= array_search($targetPageId, $modx->documentListing)) {
$url = $modx->makeUrl($targetPageId);
} else {
$url = $_REQUEST['refurl'];
}
$modx->sendRedirect($url,0,'REDIRECT_REFRESH');
}
else {
// login home page
$url = $modx->makeUrl($id);
$modx->sendRedirect($url);
}
There are also a number of instances where, for example
if ($modx->config['login_home']) ...
has become
if (isset($modx->config['login_home'])) ...
Thanks.