From a5d71d855f63b449bc23fb2887bef784a823dec6 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 12 Oct 2025 12:03:07 +0200 Subject: [PATCH 01/97] chore: prepare for next release --- CHANGELOG.md | 2 ++ Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7683a081..d860e72b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # PrivateBin version history +## 2.0.2 (not yet released) + ## 2.0.1 (2025-10-12) * ADDED: Auto shorten URLs with config option `shortenbydefault` (#1627) * ADDED: Added `shortenviashlink` endpoint with an `shlink` configuration section diff --git a/Makefile b/Makefile index 9a833116..6e5fc75f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: all coverage coverage-js coverage-php doc doc-js doc-php increment sign test test-js test-php help CURRENT_VERSION = 2.0.1 -VERSION ?= 2.0.1 +VERSION ?= 2.0.2 VERSION_FILES = README.md SECURITY.md doc/Installation.md js/package.json lib/Controller.php Makefile REGEX_CURRENT_VERSION := $(shell echo $(CURRENT_VERSION) | sed "s/\./\\\./g") REGEX_VERSION := $(shell echo $(VERSION) | sed "s/\./\\\./g") From 60bab2badbe05e560ea66836f78ba13bcae556e6 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 12 Oct 2025 18:19:46 +0200 Subject: [PATCH 02/97] make OPcache optional, resolves #1678 --- doc/Installation.md | 2 +- lib/Data/Filesystem.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/Installation.md b/doc/Installation.md index f8f97500..36d3365e 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -30,7 +30,7 @@ for more information. ### Optional Requirements - PHP with GD extension (when using identicon or vizhash icons, jdenticon works - without it) + without it) and OPcache (for better performance) - a database supported by [PHP PDO](https://php.net/manual/book.pdo.php) and the PHP PDO extension (when using database storage) - a Ceph cluster with Rados gateway or AWS S3 storage (when using S3 storage) diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index b6837e26..7c921ae1 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -269,7 +269,9 @@ class Filesystem extends AbstractData { switch ($namespace) { case 'purge_limiter': - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php'); + if (function_exists('opcache_invalidate')) { + opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php'); + } return $this->_storeString( $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php', '_last_cache[$key] = $value; - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php'); + if (function_exists('opcache_invalidate')) { + opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php'); + } return $this->_storeString( $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php', '_last_cache, true) . ';' From d76796adf38db2ff070ae22e34be5005a5b3d1ca Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 12 Oct 2025 18:39:36 +0200 Subject: [PATCH 03/97] deduplicate logic --- lib/Data/Filesystem.php | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index 7c921ae1..3a9bfb50 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -267,31 +267,25 @@ class Filesystem extends AbstractData */ public function setValue($value, $namespace, $key = '') { + $file = $this->_path . DIRECTORY_SEPARATOR . $namespace . '.php'; + if (function_exists('opcache_invalidate')) { + opcache_invalidate($file); + } switch ($namespace) { case 'purge_limiter': - if (function_exists('opcache_invalidate')) { - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php'); - } - return $this->_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php', - '_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'salt.php', - '_last_cache[$key] = $value; - if (function_exists('opcache_invalidate')) { - opcache_invalidate($this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php'); - } - return $this->_storeString( - $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php', - '_last_cache, true) . ';' - ); + $content = '_last_cache, true) . ';'; + break; + default: + return false; } - return false; + return $this->_storeString($file, $content); } /** From 0bfa300c5936373087bd4d1fb1d513f96fe2da18 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 12 Oct 2025 18:40:48 +0200 Subject: [PATCH 04/97] apply StyleCI recommendation --- lib/Data/Filesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index 3a9bfb50..e4377a9f 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -280,7 +280,7 @@ class Filesystem extends AbstractData break; case 'traffic_limiter': $this->_last_cache[$key] = $value; - $content = '_last_cache, true) . ';'; + $content = '_last_cache, true) . ';'; break; default: return false; From b7286cf99ad1f5dc493e27f93a73b6ef192332f0 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 13 Oct 2025 18:51:15 +0200 Subject: [PATCH 05/97] fix bootstrap template password peek display --- tpl/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index f68a110f..5dcbb372 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -373,7 +373,7 @@ if ($PASSWORD) : ?>