]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Merge pull request #727 from ArthurHoaro/api/getlinks
[github/shaarli/Shaarli.git] / index.php
index 14754269f38dbbf9df72651f96fd2f282c464040..beb1cbca592aefae1071254c9ab95c04ea635526 100644 (file)
--- a/index.php
+++ b/index.php
@@ -204,7 +204,7 @@ function setup_login_state($conf)
        }
        // If session does not exist on server side, or IP address has changed, or session has expired, logout.
        if (empty($_SESSION['uid'])
-        || ($conf->get('security.session_protection_disabled') == false && $_SESSION['ip'] != allIPs())
+        || ($conf->get('security.session_protection_disabled') === false && $_SESSION['ip'] != allIPs())
         || time() >= $_SESSION['expires_on'])
        {
            logout();
@@ -618,7 +618,7 @@ function showDailyRSS($conf) {
         $tpl->assign('links', $links);
         $tpl->assign('rssdate', escape($dayDate->format(DateTime::RSS)));
         $tpl->assign('hide_timestamps', $conf->get('privacy.hide_timestamps', false));
-        $html = $tpl->draw('dailyrss', $return_string=true);
+        $html = $tpl->draw('dailyrss', true);
 
         echo $html . PHP_EOL;
     }
@@ -2237,6 +2237,7 @@ $app = new \Slim\App($container);
 // REST API routes
 $app->group('/api/v1', function() {
     $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo');
+    $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks');
 })->add('\Shaarli\Api\ApiMiddleware');
 
 $response = $app->run(true);