diff --git a/CHANGELOG.md b/CHANGELOG.md index 484290b8..dc1c47d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # ZeroBin version history # + * **0.22 (2015-11-09)**: + * ADDED: Tab character input support + * ADDED: Dark bootstrap theme + * ADDED: Option to hide clone button on expiring pastes + * ADDED: Option to set a different default language then English and/or enforce it as the only language + * ADDED: Database now contains version to allow automatic update of structure, only if necessary; removing database structure check on each request + * FIXING: Regressions in database layer, prohibiting pastes from being stored + * FIXING: Fixing "missing" comments when they were posted during the same second to the same paste + * CHANGED: Switching positions of "New" and "Send" button, highlighting the latter to improve workflow + * CHANGED: Renamed config file to make updates easier + * CHANGED: Switching to JSON-based REST-API + * CHANGED: Database structure to store attachments, allowing larger attachments to be stored (depending on maximum BLOB size of database backend) + * CHANGED: Refactored data model, traffic limiting & request handling * **0.21.1 (2015-09-21)**: * FIXING: lost meta data when using DB model instead of flat files * FIXING: mobile navbar getting triggered on load diff --git a/cfg/conf.ini.sample b/cfg/conf.ini.sample index 41c63382..4fdce17f 100644 --- a/cfg/conf.ini.sample +++ b/cfg/conf.ini.sample @@ -5,7 +5,7 @@ ; @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin ; @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) ; @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License -; @version 0.21.1 +; @version 0.22 [main] ; enable or disable the discussion feature, defaults to true diff --git a/css/bootstrap/zerobin.css b/css/bootstrap/zerobin.css index cbfa93d3..7135289a 100644 --- a/css/bootstrap/zerobin.css +++ b/css/bootstrap/zerobin.css @@ -1,4 +1,4 @@ -/* ZeroBin 0.21.1 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */ +/* ZeroBin 0.22 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */ body { diff --git a/css/zerobin.css b/css/zerobin.css index b8d11f1f..966c7506 100644 --- a/css/zerobin.css +++ b/css/zerobin.css @@ -1,4 +1,4 @@ -/* ZeroBin 0.21.1 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */ +/* ZeroBin 0.22 - http://sebsauvage.net/wiki/doku.php?id=php:zerobin */ /* CSS Reset from YUI 3.4.1 (build 4118) - Copyright 2011 Yahoo! Inc. All rights reserved. diff --git a/js/zerobin.js b/js/zerobin.js index dcdee965..3dadae9f 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -6,7 +6,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ 'use strict'; @@ -583,7 +583,7 @@ $(function() { helper.urls2links(this.clearText); helper.urls2links(this.prettyPrint); this.clearText.addClass('hidden'); - if (format == 'plaintext') + if (format == 'plaintext') { this.prettyPrint.css('white-space', 'pre-wrap'); this.prettyPrint.css('word-break', 'normal'); diff --git a/lib/auto.php b/lib/auto.php index b9eaf05c..46efa031 100644 --- a/lib/auto.php +++ b/lib/auto.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ spl_autoload_register('auto::loader'); diff --git a/lib/configuration.php b/lib/configuration.php index 91fbb308..7895b60e 100644 --- a/lib/configuration.php +++ b/lib/configuration.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/filter.php b/lib/filter.php index 55ca709f..f9bc4639 100644 --- a/lib/filter.php +++ b/lib/filter.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/i18n.php b/lib/i18n.php index 5eb2b5e3..0900ef30 100644 --- a/lib/i18n.php +++ b/lib/i18n.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/model.php b/lib/model.php index 9a5e1f47..d02d5edd 100644 --- a/lib/model.php +++ b/lib/model.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/model/abstract.php b/lib/model/abstract.php index 6beb9f8c..979f759b 100644 --- a/lib/model/abstract.php +++ b/lib/model/abstract.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** @@ -80,6 +80,7 @@ abstract class model_abstract * Set ID. * * @access public + * @param string $id * @throws Exception * @return void */ diff --git a/lib/model/comment.php b/lib/model/comment.php index 53d5e5fb..1c095332 100644 --- a/lib/model/comment.php +++ b/lib/model/comment.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** @@ -161,6 +161,14 @@ class model_comment extends model_abstract return $this->_data->meta->parentid; } + /** + * Set nickname. + * + * @access public + * @param string $nickname + * @throws Exception + * @return void + */ public function setNickname($nickname) { if (!sjcl::isValid($nickname)) throw new Exception('Invalid data.', 66); diff --git a/lib/model/paste.php b/lib/model/paste.php index 0fc4cb2f..9dc2ab0a 100644 --- a/lib/model/paste.php +++ b/lib/model/paste.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/persistence.php b/lib/persistence.php index 14f5931d..3b1f9af8 100644 --- a/lib/persistence.php +++ b/lib/persistence.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/request.php b/lib/request.php index b5dfb86e..baa67064 100644 --- a/lib/request.php +++ b/lib/request.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** @@ -162,7 +162,7 @@ class request /** * Override the default input stream source, used for unit testing. * - * @param unknown $input + * @param string $input */ public static function setInputStream($input) { diff --git a/lib/serversalt.php b/lib/serversalt.php index 776f47c1..30bc0b10 100644 --- a/lib/serversalt.php +++ b/lib/serversalt.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/sjcl.php b/lib/sjcl.php index a352ba9c..625565bb 100644 --- a/lib/sjcl.php +++ b/lib/sjcl.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/trafficlimiter.php b/lib/trafficlimiter.php index 4b7b4e20..ea351010 100644 --- a/lib/trafficlimiter.php +++ b/lib/trafficlimiter.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/vizhash16x16.php b/lib/vizhash16x16.php index 615ce661..b1a95af0 100644 --- a/lib/vizhash16x16.php +++ b/lib/vizhash16x16.php @@ -8,7 +8,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:vizhash_gd * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.0.4 beta ZeroBin 0.21.1 + * @version 0.0.4 beta ZeroBin 0.22 */ /** diff --git a/lib/zerobin.php b/lib/zerobin.php index 02d23217..81796087 100644 --- a/lib/zerobin.php +++ b/lib/zerobin.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/zerobin/abstract.php b/lib/zerobin/abstract.php index 5ca481f0..51b65b8b 100644 --- a/lib/zerobin/abstract.php +++ b/lib/zerobin/abstract.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/zerobin/data.php b/lib/zerobin/data.php index 1b8c6978..4ce4fc38 100644 --- a/lib/zerobin/data.php +++ b/lib/zerobin/data.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/lib/zerobin/db.php b/lib/zerobin/db.php index 1f1fed8b..4475bfea 100644 --- a/lib/zerobin/db.php +++ b/lib/zerobin/db.php @@ -7,7 +7,7 @@ * @link http://sebsauvage.net/wiki/doku.php?id=php:zerobin * @copyright 2012 Sébastien SAUVAGE (sebsauvage.net) * @license http://www.opensource.org/licenses/zlib-license.php The zlib/libpng License - * @version 0.21.1 + * @version 0.22 */ /** diff --git a/tst/configGenerator.php b/tst/configGenerator.php index e48175af..e0b688e6 100755 --- a/tst/configGenerator.php +++ b/tst/configGenerator.php @@ -463,7 +463,7 @@ class configurationTestGenerator /** * DO NOT EDIT: This file is generated automatically using configGenerator.php */ -class configurationTest extends PHPUnit_Framework_TestCase +class configurationCombinationsTest extends PHPUnit_Framework_TestCase { private $_model; @@ -539,6 +539,8 @@ EOT; case 'Create': $code .= PHP_EOL . <<<'EOT' $_POST = helper::getPaste(); + $_SERVER['HTTP_X_REQUESTED_WITH'] = 'JSONHttpRequest'; + $_SERVER['REQUEST_METHOD'] = 'POST'; $_SERVER['REMOTE_ADDR'] = '::1'; EOT; break; @@ -580,7 +582,7 @@ EOT; $this->assertTag( array( 'id' => 'cipherdata', - 'content' => htmlspecialchars(json_encode(helper::getPaste()), ENT_NOQUOTES) + 'content' => htmlspecialchars(helper::getPasteAsJson(), ENT_NOQUOTES) ), $content, 'outputs data correctly'