Checking url-friendly when redirect

master
vbracco 2008-10-27 12:09:20 +00:00
parent 13b89106cc
commit 178101dc04
2 changed files with 7 additions and 3 deletions

View File

@ -44,8 +44,12 @@ if(isset($_POST["btnAdd"])) {
$_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0"; $_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0";
$_POST["ip_user"] = $_SERVER["REMOTE_ADDR"]; $_POST["ip_user"] = $_SERVER["REMOTE_ADDR"];
$strEnd=($conf->urlFriendly) ? "/" : "";
if ($comment->addComment($_POST)) { if ($comment->addComment($_POST)) {
header("Location: ".$conf->urlGelato."/index.php/post/".$_POST["id_post"]); header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
die();
} else {
header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
die(); die();
} }
} }

View File

@ -365,8 +365,8 @@ if ($user->isAuthenticated()) {
if ($tumble->contarRegistros()>0) { if ($tumble->contarRegistros()>0) {
while($register = mysql_fetch_array($rs)) { while($register = mysql_fetch_array($rs)) {
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); $formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/"; $strEnd=($conf->urlFriendly) ? "/" : "";
$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
$register["title"] = stripslashes($register["title"]); $register["title"] = stripslashes($register["title"]);
$register["description"] = stripslashes($register["description"]); $register["description"] = stripslashes($register["description"]);