]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #666 from ArthurHoaro/slim-api
authorArthur <arthur@hoa.ro>
Tue, 20 Dec 2016 10:30:05 +0000 (11:30 +0100)
committerGitHub <noreply@github.com>
Tue, 20 Dec 2016 10:30:05 +0000 (11:30 +0100)
REST API structure using Slim framework

.travis.yml
index.php
plugins/markdown/markdown.meta
tpl/loginform.html

index 88cc827d5d4ed19cc3f3dbe381e022e4ab48796f..03071a4734535485b8f9cc0f0106a3f8668de34c 100644 (file)
@@ -4,6 +4,7 @@ cache:
   directories:
     - $HOME/.composer/cache
 php:
+  - 7.1
   - 7.0
   - 5.6
   - 5.5
index 835fd7d29b60370bbb7c5683a23022dbfb1f8074..eb73941deded389a6521264cf9112358e71543fb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1245,10 +1245,12 @@ function renderPage($conf, $pluginManager, $LINKSDB)
             // Edit
             $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
             $updated = new DateTime();
+            $shortUrl = $LINKSDB[$id]['shorturl'];
         } else {
             // New link
             $created = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $linkdate);
             $updated = null;
+            $shortUrl = link_small_hash($created, $id);
         }
 
         // Remove multiple spaces.
@@ -1275,7 +1277,7 @@ function renderPage($conf, $pluginManager, $LINKSDB)
             'created' => $created,
             'updated' => $updated,
             'tags' => str_replace(',', ' ', $tags),
-            'shorturl' => link_small_hash($created, $id),
+            'shorturl' => $shortUrl,
         );
 
         // If title is empty, use the URL as title.
index 8df2ed0bc3b6af6694166c3c613db97d8fdf924a..322856ea9c146ff55916240c1e5a3d7d64602d15 100644 (file)
@@ -1,4 +1,4 @@
 description="Render shaare description with Markdown syntax.<br><strong>Warning</strong>:
-If your shaared descriptions containing HTML tags before enabling the markdown plugin,
+If your shaared descriptions contained HTML tags before enabling the markdown plugin,
 enabling it might break your page.
 See the <a href=\"https://github.com/shaarli/Shaarli/tree/master/plugins/markdown#html-rendering\">README</a>."
index a49b42d3c0de71aa1d699c05dd05abe7d981c78d..84176385765837973d77be29941db622ccad1f6a 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 <head>{include="includes"}</head>
 <body
-{if="ban_canLogin()"}
+{if="ban_canLogin($conf)"}
   {if="empty($username)"}
     onload="document.loginform.login.focus();"
   {else}
@@ -13,7 +13,7 @@
   {include="page.header"}
 
   <div id="headerform">
-    {if="!ban_canLogin()"}
+    {if="!ban_canLogin($conf)"}
       You have been banned from login after too many failed attempts. Try later.
     {else}
       <form method="post" name="loginform">