From 24a4328c55c68e7480d6988e189ef75b16da223d Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 9 Nov 2015 21:39:42 +0100 Subject: [PATCH] incrementing version, updating changelog, added missing phpdoc comments --- CHANGELOG.md | 13 +++++++++++++ cfg/conf.ini.sample | 2 +- css/bootstrap/zerobin.css | 2 +- css/zerobin.css | 2 +- js/zerobin.js | 4 ++-- lib/auto.php | 2 +- lib/configuration.php | 2 +- lib/filter.php | 2 +- lib/i18n.php | 2 +- lib/model.php | 2 +- lib/model/abstract.php | 3 ++- lib/model/comment.php | 10 +++++++++- lib/model/paste.php | 2 +- lib/persistence.php | 2 +- lib/request.php | 4 ++-- lib/serversalt.php | 2 +- lib/sjcl.php | 2 +- lib/trafficlimiter.php | 2 +- lib/vizhash16x16.php | 2 +- lib/zerobin.php | 2 +- lib/zerobin/abstract.php | 2 +- lib/zerobin/data.php | 2 +- lib/zerobin/db.php | 2 +- tst/configGenerator.php | 6 ++++-- 24 files changed, 50 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 484290b..dc1c47d 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 41c6338..4fdce17 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 cbfa93d..7135289 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 b8d11f1..966c750 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 dcdee96..3dadae9 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 b9eaf05..46efa03 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 91fbb30..7895b60 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 55ca709..f9bc463 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 5eb2b5e..0900ef3 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 9a5e1f4..d02d5ed 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 6beb9f8..979f759 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 53d5e5f..1c09533 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 0fc4cb2..9dc2ab0 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 14f5931..3b1f9af 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 b5dfb86..baa6706 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 776f47c..30bc0b1 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 a352ba9..625565b 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 4b7b4e2..ea35101 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 615ce66..b1a95af 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 02d2321..8179608 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 5ca481f..51b65b8 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 1b8c697..4ce4fc3 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 1f1fed8..4475bfe 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 e48175a..e0b688e 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'