X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=066058e617d651e01297abb2515b3573cd06fc50;hb=3ef1da28e8cc5afcfe58be067e7e60528ce72f1a;hp=a8326a2b4422baad7ee32ac3b266e3eb3328614c;hpb=01b8f52718f5136fb7de54e09b47ae4523aec9e8;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index a8326a2b..066058e6 100644 --- a/index.php +++ b/index.php @@ -1547,7 +1547,7 @@ function renderPage() $tags = trim(preg_replace('/\s\s+/',' ', $_POST['lf_tags'])); // Remove multiple spaces. $linkdate=$_POST['lf_linkdate']; $url = trim($_POST['lf_url']); - if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?')) + if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?') && !startsWith($url,'javascript:')) $url = 'http://'.$url; $link = array('title'=>trim($_POST['lf_title']),'url'=>$url,'description'=>trim($_POST['lf_description']),'private'=>(isset($_POST['lf_private']) ? 1 : 0), 'linkdate'=>$linkdate,'tags'=>str_replace(',',' ',$tags)); @@ -1560,6 +1560,7 @@ function renderPage() if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo ''; exit; } $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. + if (strstr($returnurl, "do=addlink")) { $returnurl = '?'; } //if we come from ?do=addlink, set returnurl to homepage instead header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. exit; }