From 101202a031541728e59a5bfe39c489416748b095 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Sun, 18 May 2014 21:18:06 -0400 Subject: [PATCH 1/6] Fix edit board link not appearing --- templates/post/post_controls.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/post/post_controls.html b/templates/post/post_controls.html index 78ee5842..99a8484c 100644 --- a/templates/post/post_controls.html +++ b/templates/post/post_controls.html @@ -48,10 +48,10 @@ {% else %} {{ config.mod.link_move }}  {% endif %} +{% endif %} {% if mod|hasPermission(config.mod.editpost, board.uri) %} {{ config.mod.link_editpost }}  {% endif %} -{% endif %} {% endif %} From ff809ccf71ac6e353faec3095bb193c5d49611bb Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 13:39:30 -0400 Subject: [PATCH 2/6] SECURITY: Remove $config[db][password] when $config[debug] is TRUE --- inc/display.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inc/display.php b/inc/display.php index c836247e..bfc8eeea 100644 --- a/inc/display.php +++ b/inc/display.php @@ -109,6 +109,18 @@ function error($message, $priority = true, $debug_stuff = false) { ))); } + $pw = $config['db']['password']; + $debug_callback = function(&$item) use (&$debug_callback, $pw) { + global $config; + if (is_array($item)) { + $item = array_filter($item, $debug_callback); + } + return ($item !== $pw || !$pw); + }; + + + $debug_stuff = array_filter($debug_stuff, $debug_callback); + die(Element('page.html', array( 'config' => $config, 'title' => _('Error'), From 85136b76ed9f1e6d9f2185e02a05b7307215182b Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 13:46:18 -0400 Subject: [PATCH 3/6] No need for global config --- inc/display.php | 1 - 1 file changed, 1 deletion(-) diff --git a/inc/display.php b/inc/display.php index bfc8eeea..ab2daeb6 100644 --- a/inc/display.php +++ b/inc/display.php @@ -111,7 +111,6 @@ function error($message, $priority = true, $debug_stuff = false) { $pw = $config['db']['password']; $debug_callback = function(&$item) use (&$debug_callback, $pw) { - global $config; if (is_array($item)) { $item = array_filter($item, $debug_callback); } From 65a14a0d39da375a08f4dfbb7225ee7906bb0601 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 14:00:16 -0400 Subject: [PATCH 4/6] Fix moving of deleted files --- inc/mod/pages.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 1452d109..03f00ef1 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1199,6 +1199,8 @@ function mod_move($originBoard, $postID) { $post['files'] = json_decode($post['files'], TRUE); $post['has_file'] = true; foreach ($post['files'] as $i => &$file) { + if ($file['file'] === 'deleted') + continue; $file['file_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']; $file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']; } @@ -1218,8 +1220,9 @@ function mod_move($originBoard, $postID) { if ($post['has_file']) { // copy image foreach ($post['files'] as $i => &$file) { - $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); - if (!in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) + if ($file['file'] !== 'deleted') + $clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); + if (isset($file['thumb']) && !in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']); } } From 0be16cf1782724131a3de80b691d08a5a964638f Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 14:11:24 -0400 Subject: [PATCH 5/6] Fix js error when allow_delete is false --- templates/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/main.js b/templates/main.js index 953d8849..231b8043 100644 --- a/templates/main.js +++ b/templates/main.js @@ -264,10 +264,14 @@ var script_settings = function(script_name) { function init() { init_stylechooser(); - + + {% endraw %} + {% if config.allow_delete %} if (document.forms.postcontrols) { document.forms.postcontrols.password.value = localStorage.password; } + {% endif %} + {% raw %} if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1)) highlightReply(window.location.hash.substring(1)); From bd94d0c392372a2d34faf03bb57f3c82fe84b88c Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Mon, 19 May 2014 14:18:46 -0400 Subject: [PATCH 6/6] Fix inline epxanding of videos --- js/expand-video.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/expand-video.js b/js/expand-video.js index 84a9108f..76a2018e 100644 --- a/js/expand-video.js +++ b/js/expand-video.js @@ -94,6 +94,7 @@ function setupVideo(thumb, url) { videoHide.style.display = "inline"; videoContainer.style.display = "block"; videoContainer.style.position = "static"; + video.parentNode.parentNode.removeAttribute('style'); thumb.style.display = "none"; video.muted = (setting("videovolume") == 0);