changed link() better handle mis-use

This commit is contained in:
seek3r 2001-01-05 07:59:46 +00:00
parent 891c0f2d6e
commit bc71ebf3e0
3 changed files with 13 additions and 2 deletions

View File

@ -240,7 +240,17 @@
// next line adds index.php when one is assumed since
// iis will not interpret urls like http://.../addressbook/?xyz=5
return str_replace("/?", "/index.php?", $url);
$url = str_replace("/?", "/index.php?", $url);
$html_check = strtolower(substr($url ,0,4));
$slash_check = strtolower(substr($url ,0,1));
if($url_check != "http") {
if($slash_check != "/") {
$url = $phpgw_info["server"]["hostname"].$phpgw_info["server"]["webserver_url"]."/".$url;
} else{
$url = $phpgw_info["server"]["hostname"].$url;
}
}
return $url;
}
function strip_html($s)

View File

@ -852,6 +852,7 @@
case 15: $s .= lang("Entry updated sucessfully"); break;
case 16: $s .= lang("Entry has been deleted sucessfully"); break;
case 18: $s .= lang("Password has been updated"); break;
case 38: $s .= lang("Password could not be changed"); break;
case 19: $s .= lang("Session has been killed"); break;
case 27: $s .= lang("Account has been updated"); break;
case 28: $s .= lang("Account has been created"); break;

View File

@ -77,7 +77,7 @@
$passwd_changed = $phpgw->auth->change_password($o_passwd, $n_passwd);
if (!$passwd_changed){
// This need to be changed to show a different message based on the result
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/"));
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=38"));
}else{
$phpgw_info["user"]["passwd"] = $phpgw->auth->change_password($o_passwd, $n_passwd);
$phpgw->accounts->sync();