aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authornodiscc <nodiscc@gmail.com>2014-08-11 00:04:51 +0200
committernodiscc <nodiscc@gmail.com>2014-08-11 00:13:29 +0200
commita1795ddcf3d1dcef0ca213a5bfb75b8237dfb646 (patch)
tree45c3e66bba3f783f6c59b17f2d539061d44c8208 /index.php
parente411f7f9d7682256fdba017d409e8356c4644ab9 (diff)
downloadShaarli-a1795ddcf3d1dcef0ca213a5bfb75b8237dfb646.tar.gz
Shaarli-a1795ddcf3d1dcef0ca213a5bfb75b8237dfb646.tar.zst
Shaarli-a1795ddcf3d1dcef0ca213a5bfb75b8237dfb646.zip
bookmarklet: use selected text as description when adding a new link
* Based on romnGit's work at https://github.com/sebsauvage/Shaarli/pull/104 * Fixes https://github.com/shaarli/Shaarli/issues/18 * Closes https://github.com/sebsauvage/Shaarli/pull/104 * Fixes https://github.com/sebsauvage/Shaarli/issues/53 * Fixes https://github.com/sebsauvage/Shaarli/issues/129 * Fixes https://github.com/sebsauvage/Shaarli/issues/33
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/index.php b/index.php
index 5dd0353b..24b93fa6 100644
--- a/index.php
+++ b/index.php
@@ -425,7 +425,7 @@ if (isset($_POST['login']))
425 session_regenerate_id(true); 425 session_regenerate_id(true);
426 } 426 }
427 // Optional redirect after login: 427 // Optional redirect after login:
428 if (isset($_GET['post'])) { header('Location: ?post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); exit; } 428 if (isset($_GET['post'])) { header('Location: ?post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); exit; }
429 if (isset($_POST['returnurl'])) 429 if (isset($_POST['returnurl']))
430 { 430 {
431 if (endsWith($_POST['returnurl'],'?do=login')) { header('Location: ?'); exit; } // Prevent loops over login screen. 431 if (endsWith($_POST['returnurl'],'?do=login')) { header('Location: ?'); exit; } // Prevent loops over login screen.
@@ -437,7 +437,7 @@ if (isset($_POST['login']))
437 { 437 {
438 ban_loginFailed(); 438 ban_loginFailed();
439 $redir = ''; 439 $redir = '';
440 if (isset($_GET['post'])) { $redir = '&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):''); } 440 if (isset($_GET['post'])) { $redir = '&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):''); }
441 echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen. 441 echo '<script language="JavaScript">alert("Wrong login/password.");document.location=\'?do=login'.$redir.'\';</script>'; // Redirect to login screen.
442 exit; 442 exit;
443 } 443 }
@@ -1336,7 +1336,7 @@ function renderPage()
1336 // Show login screen, then redirect to ?post=... 1336 // Show login screen, then redirect to ?post=...
1337 if (isset($_GET['post'])) 1337 if (isset($_GET['post']))
1338 { 1338 {
1339 header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link. 1339 header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
1340 exit; 1340 exit;
1341 } 1341 }
1342 $PAGE = new pageBuilder; 1342 $PAGE = new pageBuilder;