## [v0.9.0](https://github.com/shaarli/Shaarli/releases/tag/v0.9.0) - UNPUBLISHED
+This release introduces the REST API, and requires updating HTTP server
+configuration to enable URL rewriting, see:
+- https://shaarli.github.io/api-documentation/
+- https://github.com/shaarli/Shaarli/wiki/Server-configuration
+
**WARNING**: Shaarli now requires PHP 5.5+.
### Added
-
-- REST API: see [Shaarli API documentation](http://shaarli.github.io/api-documentation/)
-- The theme can now be selected in the administration page.
+- REST API v1
+ - [Slim](https://www.slimframework.com/) framework
+ - [JSON Web Token](https://jwt.io/introduction/) (JWT) authentication
+ - versioned API endpoints:
+ - `/api/v1/info`: get general information on the Shaarli instance
+ - `/api/v1/links`: get a list of shaared links
+- Allow selecting themes/templates from the configuration page
+- Add plugin placeholders to Atom/RSS feed templates
+- Add OpenSearch to feed templates
+- Add `campaign_` to the URL cleanup pattern list
+- Add an AUTHORS file and Makefile target to list authors from Git commit data
### Changed
+- Docker: enable nginx URL rewriting for the REST API
+- Move `user.css` to the `data` folder
+- Move default template files to a subfolder (`default`)
+- Move PubSubHub to a dedicated plugin
+- Coding style:
+ - explicit method visibility
+ - safe boolean comparisons
+ - remove unused variables
+- The updater now keeps custom theme preferences
+- Simplify the COPYING information
-- Default template files are moved to a subfolder (`default`).
+
+### Removed
+- PHP < 5.5 compatibility
### Fixed
+- Ignore generated release tarballs
+- Hide default port when behind a reverse proxy
+- Fix a typo in the Markdown plugin description
+- Fix the presence of empty tags for private tags and in search results
+- Fix a fatal error during the install
+- Fix permalink image alignment in daily page
+- Fix the delete button in `editlink`
## [v0.8.1](https://github.com/shaarli/Shaarli/releases/tag/v0.8.1) - 2016-12-12
*
* Licence: http://www.opensource.org/licenses/zlib-license.php
*
- * Requires: PHP 5.3.x
+ * Requires: PHP 5.5.x
*/
// Set 'UTC' as the default timezone if it is not defined in php.ini
// Ensure the PHP version is supported
try {
- ApplicationUtils::checkPHPVersion('5.3', PHP_VERSION);
+ ApplicationUtils::checkPHPVersion('5.5', PHP_VERSION);
} catch(Exception $exc) {
header('Content-Type: text/plain; charset=utf-8');
echo $exc->getMessage();
$needle = trim($_POST['fromtag']);
// True for case-sensitive tag search.
$linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true);
- foreach($linksToAlter as $key=>$value)
- {
- $tags = explode(' ',trim($value['tags']));
- $tags[array_search($needle,$tags)] = trim($_POST['totag']); // Replace tags value.
- $value['tags']=trim(implode(' ',$tags));
- $LINKSDB[$key]=$value;
+ foreach($linksToAlter as $key=>$value) {
+ $tags = preg_split('/\s+/', trim($value['tags']));
+ // Replace tags value.
+ $tags[array_search($needle, $tags)] = trim($_POST['totag']);
+ $value['tags'] = implode(' ', array_unique($tags));
+ $LINKSDB[$key] = $value;
}
$LINKSDB->save($conf->get('resource.page_cache')); // Save to disk.
- echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>';
+ echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode(escape($_POST['totag'])).'\';</script>';
exit;
}
}
return $data;
}
-
-/**
- * When link list is displayed, include markdown CSS.
- *
- * @param array $data - includes data.
- *
- * @return mixed - includes data with markdown CSS file added.
- */
-function hook_addlink_toolbar_render_includes($data)
-{
- if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
- $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/addlink_toolbar/addlink_toolbar.css';
- }
-
- return $data;
-}
$this->assertEquals($str, $data[$str]);
$this->assertArrayNotHasKey('fields_toolbar', $data);
}
-
- /**
- * Test render_includes hook while logged in.
- */
- public function testAddlinkIncludesLoggedIn()
- {
- $str = 'stuff';
- $data = array($str => $str);
- $data['_PAGE_'] = Router::$PAGE_LINKLIST;
- $data['_LOGGEDIN_'] = true;
-
- $data = hook_addlink_toolbar_render_includes($data);
- $this->assertEquals($str, $data[$str]);
- $this->assertEquals(1, count($data['css_files']));
-
- $str = 'stuff';
- $data = array($str => $str);
- $data['_PAGE_'] = $str;
- $data['_LOGGEDIN_'] = true;
-
- $data = hook_addlink_toolbar_render_includes($data);
- $this->assertEquals($str, $data[$str]);
- $this->assertArrayNotHasKey('css_files', $data);
- }
-
- /**
- * Test render_includes hook.
- * Should not affect css files while logged out.
- */
- public function testAddlinkIncludesLoggedOut()
- {
- $str = 'stuff';
- $data = array($str => $str);
- $data['_PAGE_'] = Router::$PAGE_LINKLIST;
- $data['_LOGGEDIN_'] = false;
-
- $data = hook_addlink_toolbar_render_includes($data);
- $this->assertEquals($str, $data[$str]);
- $this->assertArrayNotHasKey('css_files', $data);
- }
}