]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fixes shaarli/Shaarli#46: allow 'javascript:' links sharing 119/head
authorArthurHoaro <arthur@hoa.ro>
Fri, 20 Feb 2015 20:46:21 +0000 (21:46 +0100)
committerArthurHoaro <arthur@hoa.ro>
Fri, 20 Feb 2015 20:46:21 +0000 (21:46 +0100)
index.php

index dfebdcad312c58dedaebf0ee893499fd050d5e26..c87b944973b0ea150a3328a781b0e17bce3e03de 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1545,7 +1545,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));