From 97069ea490b52181da8a434ff1a3e8603ac04adf Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Mon, 30 Jun 2014 15:50:20 +0800 Subject: [PATCH 1/4] Introduce $config['gzip_static'] --- inc/functions.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index efc0594b..6854d8b7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1,7 +1,7 @@ = 1024) + if (file_put_contents($gzpath, gzencode($data), $simple ? 0 : LOCK_EX) === false) + error("Unable to write to file: $gzpath"); + if (!touch($gzpath, filemtime($path), fileatime($path))) + error("Unable to touch file: $gzpath"); + } + else { + @unlink($gzpath); + } + } + if (!$skip_purge && isset($config['purge'])) { // Purge cache if (basename($path) == $config['file_index']) { From b21eccfd9023db1eb18323cc7d18e7a30a546e7a Mon Sep 17 00:00:00 2001 From: Jano Slota Date: Mon, 30 Jun 2014 15:09:57 +0200 Subject: [PATCH 2/4] Is that a typo? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2d57135..bc2d8072 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ vichan is a free light-weight, fast, highly configurable and user-friendly imageboard software package. It is written in PHP and has few dependencies. vichan is a fork of [Tinyboard](http://tinyboard.org/), a great imageboard package, actively -building on it and adding a lot of features and another improvements. +building on it and adding a lot of features and other improvements. Support and announcements: https://int.vichan.net/devel/ From f2809d47930bfd2570daa6bae16f563c0e0dcd6d Mon Sep 17 00:00:00 2001 From: 8chan Date: Tue, 24 Jun 2014 19:40:16 +0000 Subject: [PATCH 3/4] Fix issue #45 --- inc/display.php | 8 ++++---- templates/post_reply.html | 4 ++-- templates/post_thread.html | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inc/display.php b/inc/display.php index 4e8ab8fb..f02df433 100644 --- a/inc/display.php +++ b/inc/display.php @@ -377,10 +377,10 @@ class Post { $this->body ); } - public function link($pre = '') { + public function link($pre = '', $page = false) { global $config, $board; - return $this->root . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $this->thread) . '#' . $pre . $this->id; + return $this->root . $board['dir'] . $config['dir']['res'] . sprintf(($page ? $page : $config['file_page']), $this->thread) . '#' . $pre . $this->id; } public function postControls() { global $board, $config; @@ -482,10 +482,10 @@ class Thread { $this->body ); } - public function link($pre = '') { + public function link($pre = '', $page = false) { global $config, $board; - return $this->root . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $this->id) . '#' . $pre . $this->id; + return $this->root . $board['dir'] . $config['dir']['res'] . sprintf(($page ? $page : $config['file_page']), $this->id) . '#' . $pre . $this->id; } public function add(Post $post) { $this->posts[] = $post; diff --git a/templates/post_reply.html b/templates/post_reply.html index c2254844..ab0dc9da 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -12,8 +12,8 @@ {% include 'post/time.html' %} {% include 'post/poster_id.html' %}  - No. - {{ post.id }} + No. + {{ post.id }}

{% if post.embed %} {{ post.embed }} diff --git a/templates/post_thread.html b/templates/post_thread.html index 61d09636..cd8ba74a 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -44,8 +44,8 @@ {% include 'post/time.html' %} {% include 'post/poster_id.html' %}  - No. - {{ post.id }} + No. + {{ post.id }} {% if post.sticky %} {% if config.font_awesome %} From 1853efa883a8a45f27fdac25f7151c883253adfa Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 6 Jul 2014 01:20:42 +0200 Subject: [PATCH 4/4] SECURITY: backport fix for #70 for 4.5. reported by Barrucadu --- templates/post_reply.html | 2 +- templates/post_thread.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/post_reply.html b/templates/post_reply.html index ab0dc9da..6fba3c1e 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -35,7 +35,7 @@ {% if config.show_filename and post.filename %} , {% if post.filename|length > config.max_filename_display %} - {{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }} + {{ post.filename|truncate(config.max_filename_display)|e|bidi_cleanup }} {% else %} {{ post.filename|e|bidi_cleanup }} {% endif %} diff --git a/templates/post_thread.html b/templates/post_thread.html index cd8ba74a..252e6f11 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -24,7 +24,7 @@ {% if config.show_filename and post.filename %} , {% if post.filename|length > config.max_filename_display %} - {{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }} + {{ post.filename|truncate(config.max_filename_display)|e|bidi_cleanup }} {% else %} {{ post.filename|e|bidi_cleanup }} {% endif %}