1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-19 01:24:05 +01:00
This commit is contained in:
8chan 2014-05-19 19:39:35 +00:00
commit cf23161365
4 changed files with 22 additions and 3 deletions

View File

@ -109,6 +109,17 @@ function error($message, $priority = true, $debug_stuff = false) {
))); )));
} }
$pw = $config['db']['password'];
$debug_callback = function(&$item) use (&$debug_callback, $pw) {
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( die(Element('page.html', array(
'config' => $config, 'config' => $config,
'title' => _('Error'), 'title' => _('Error'),

View File

@ -1213,6 +1213,8 @@ function mod_move($originBoard, $postID) {
$post['files'] = json_decode($post['files'], TRUE); $post['files'] = json_decode($post['files'], TRUE);
$post['has_file'] = true; $post['has_file'] = true;
foreach ($post['files'] as $i => &$file) { 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['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']; $file['thumb_path'] = sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb'];
} }
@ -1232,8 +1234,9 @@ function mod_move($originBoard, $postID) {
if ($post['has_file']) { if ($post['has_file']) {
// copy image // copy image
foreach ($post['files'] as $i => &$file) { foreach ($post['files'] as $i => &$file) {
$clone($file['file_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $file['file']); if ($file['file'] !== 'deleted')
if (!in_array($file['thumb'], array('spoiler', 'deleted', 'file'))) $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']); $clone($file['thumb_path'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $file['thumb']);
} }
} }

View File

@ -94,6 +94,7 @@ function setupVideo(thumb, url) {
videoHide.style.display = "inline"; videoHide.style.display = "inline";
videoContainer.style.display = "block"; videoContainer.style.display = "block";
videoContainer.style.position = "static"; videoContainer.style.position = "static";
video.parentNode.parentNode.removeAttribute('style');
thumb.style.display = "none"; thumb.style.display = "none";
video.muted = (setting("videovolume") == 0); video.muted = (setting("videovolume") == 0);

View File

@ -266,10 +266,14 @@ var script_settings = function(script_name) {
function init() { function init() {
init_stylechooser(); init_stylechooser();
{% endraw %}
{% if config.allow_delete %}
if (document.forms.postcontrols) { if (document.forms.postcontrols) {
document.forms.postcontrols.password.value = localStorage.password; document.forms.postcontrols.password.value = localStorage.password;
} }
{% endif %}
{% raw %}
if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1)) if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1))
highlightReply(window.location.hash.substring(1)); highlightReply(window.location.hash.substring(1));