]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #731 from virtualtam/fix/api/namespaces
authorVirtualTam <virtualtam+github@flibidi.net>
Tue, 3 Jan 2017 15:21:18 +0000 (16:21 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2017 15:21:18 +0000 (16:21 +0100)
API: fix Slim namespaces

1  2 
index.php

diff --combined index.php
index a4d7d7cac3e7269ef96ace736950cb241a3a6ad1,a970e29fe86b06d55601bde083b1debacb5263b5..bb1debd3f515bcd5bf2a3b892b3b60890812c092
+++ b/index.php
@@@ -1601,8 -1601,8 +1601,8 @@@ function renderPage($conf, $pluginManag
  function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
  {
      // Used in templates
 -    $searchtags = !empty($_GET['searchtags']) ? escape($_GET['searchtags']) : '';
 -    $searchterm = !empty($_GET['searchterm']) ? escape($_GET['searchterm']) : '';
 +    $searchtags = !empty($_GET['searchtags']) ? escape(normalize_spaces($_GET['searchtags'])) : '';
 +    $searchterm = !empty($_GET['searchterm']) ? escape(normalize_spaces($_GET['searchterm'])) : '';
  
      // Smallhash filter
      if (! empty($_SERVER['QUERY_STRING'])
          } else {
              $link['updated_timestamp'] = '';
          }
 -        $taglist = explode(' ', $link['tags']);
 +        $taglist = preg_split('/\s+/', $link['tags'], -1, PREG_SPLIT_NO_EMPTY);
          uasort($taglist, 'strcasecmp');
          $link['taglist'] = $taglist;
          // Check for both signs of a note: starting with ? and 7 chars long.
@@@ -1949,8 -1949,8 +1949,8 @@@ function install($conf
          $conf->set(
              'api.secret',
              generate_api_secret(
 -                $this->conf->get('credentials.login'),
 -                $this->conf->get('credentials.salt')
 +                $conf->get('credentials.login'),
 +                $conf->get('credentials.salt')
              )
          );
          try {
@@@ -2231,8 -2231,8 +2231,8 @@@ $app = new \Slim\App($container)
  
  // REST API routes
  $app->group('/api/v1', function() {
-     $this->get('/info', '\Api\Controllers\Info:getInfo');
- })->add('\Api\ApiMiddleware');
+     $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo');
+ })->add('\Shaarli\Api\ApiMiddleware');
  
  $response = $app->run(true);
  // Hack to make Slim and Shaarli router work together: