From 15a65caf9d4d98b9987eefb04b98180ce3c47aa9 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 19:45:30 +0200 Subject: [PATCH 1/5] update wpaint; fix wpaint.js --- js/wPaint | 2 +- js/wpaint.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/wPaint b/js/wPaint index 2c272dff..15bae4a9 160000 --- a/js/wPaint +++ b/js/wPaint @@ -1 +1 @@ -Subproject commit 2c272dffca0f3d7b7163bd82ba15629f54409278 +Subproject commit 15bae4a9181ddb283c1cad0979c44cefd4f15a44 diff --git a/js/wpaint.js b/js/wpaint.js index 93d29bbc..9c619070 100644 --- a/js/wpaint.js +++ b/js/wpaint.js @@ -83,7 +83,7 @@ oekaki.init = function() { stop: function(event,ui) { $("#wpaintdiv").wPaint("resize"); }, - alsoResize: "#wpaintdiv, #wpaintdiv canvas", + alsoResize: "#wpaintdiv", }); $('#wpaintctr .ui-resizable-se').css({'height':'12px', 'width':'12px'}); From a53f52696e429881fa439ed0f825b46f3676720c Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 20:15:57 +0200 Subject: [PATCH 2/5] remove post-hider symlink --- js/post-hider.js | 1 - 1 file changed, 1 deletion(-) delete mode 120000 js/post-hider.js diff --git a/js/post-hider.js b/js/post-hider.js deleted file mode 120000 index 693c14d6..00000000 --- a/js/post-hider.js +++ /dev/null @@ -1 +0,0 @@ -hide-threads.js \ No newline at end of file From d57dcc5e6e786a2122c80e0e5074ab8390a73c1b Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 20:50:28 +0200 Subject: [PATCH 3/5] fix remote upload --- post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 907bd433..12584c51 100644 --- a/post.php +++ b/post.php @@ -320,6 +320,7 @@ if (isset($_POST['delete'])) { $_FILES['file'] = array( 'name' => basename($url_without_params), 'tmp_name' => $post['file_tmp'], + 'file_tmp' => true, 'error' => 0, 'size' => filesize($post['file_tmp']) ); @@ -704,7 +705,7 @@ if (isset($_POST['delete'])) { chmod($file['file'], 0644); } elseif (!@move_uploaded_file($file['tmp_name'], $file['file'])) error($config['error']['nomove']); - } + } } if ($config['image_reject_repost']) { From 46802d3f1be8eef229539b2404baa752f8f670c3 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 21:18:17 +0200 Subject: [PATCH 4/5] fix post event --- post.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 12584c51..48973b11 100644 --- a/post.php +++ b/post.php @@ -758,7 +758,11 @@ if (isset($_POST['delete'])) { } $post = (object)$post; - if ($error = event('post', $post)) { + $post->files = array_map(function($a) { return (object)$a; }, $post->files); + $error = event('post', $post); + $post->files = array_map(function($a) { return (array)$a; }, $post->files); + + if ($error) { undoImage((array)$post); error($error); } From a2d62ce96d1446c1314cf81591c896c295cfd881 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 29 Apr 2014 21:18:37 +0200 Subject: [PATCH 5/5] fix webm for multiimage --- inc/lib/webm/posthandler.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/inc/lib/webm/posthandler.php b/inc/lib/webm/posthandler.php index 50adbe80..1f831f5a 100644 --- a/inc/lib/webm/posthandler.php +++ b/inc/lib/webm/posthandler.php @@ -5,43 +5,43 @@ function postHandler($post) { global $board, $config; - if ($post->has_file && $post->extension == 'webm') { + if ($post->has_file) foreach ($post->files as &$file) if ($file->extension == 'webm') { require_once dirname(__FILE__) . '/videodata.php'; - $videoDetails = videoData($post->file_path); + $videoDetails = videoData($file->file_path); if (!isset($videoDetails['container']) || $videoDetails['container'] != 'webm') return "not a WebM file"; // Set thumbnail - $thumbName = $board['dir'] . $config['dir']['thumb'] . $post->file_id . '.webm'; + $thumbName = $board['dir'] . $config['dir']['thumb'] . $file->file_id . '.webm'; if ($config['spoiler_images'] && isset($_POST['spoiler'])) { // Use spoiler thumbnail - $post->thumb = 'spoiler'; + $file->thumb = 'spoiler'; $size = @getimagesize($config['spoiler_image']); - $post->thumbwidth = $size[0]; - $post->thumbheight = $size[1]; + $file->thumbwidth = $size[0]; + $file->thumbheight = $size[1]; } elseif (isset($videoDetails['frame']) && $thumbFile = fopen($thumbName, 'wb')) { // Use single frame from video as pseudo-thumbnail fwrite($thumbFile, $videoDetails['frame']); fclose($thumbFile); - $post->thumb = $post->file_id . '.webm'; + $file->thumb = $file->file_id . '.webm'; } else { // Fall back to file thumbnail - $post->thumb = 'file'; + $file->thumb = 'file'; } unset($videoDetails['frame']); // Set width and height if (isset($videoDetails['width']) && isset($videoDetails['height'])) { - $post->width = $videoDetails['width']; - $post->height = $videoDetails['height']; - if ($post->thumb != 'file' && $post->thumb != 'spoiler') { + $file->width = $videoDetails['width']; + $file->height = $videoDetails['height']; + if ($file->thumb != 'file' && $file->thumb != 'spoiler') { $thumbMaxWidth = $post->op ? $config['thumb_op_width'] : $config['thumb_width']; $thumbMaxHeight = $post->op ? $config['thumb_op_height'] : $config['thumb_height']; if ($videoDetails['width'] > $thumbMaxWidth || $videoDetails['height'] > $thumbMaxHeight) { - $post->thumbwidth = min($thumbMaxWidth, intval(round($videoDetails['width'] * $thumbMaxHeight / $videoDetails['height']))); - $post->thumbheight = min($thumbMaxHeight, intval(round($videoDetails['height'] * $thumbMaxWidth / $videoDetails['width']))); + $file->thumbwidth = min($thumbMaxWidth, intval(round($videoDetails['width'] * $thumbMaxHeight / $videoDetails['height']))); + $file->thumbheight = min($thumbMaxHeight, intval(round($videoDetails['height'] * $thumbMaxWidth / $videoDetails['width']))); } else { - $post->thumbwidth = $videoDetails['width']; - $post->thumbheight = $videoDetails['height']; + $file->thumbwidth = $videoDetails['width']; + $file->thumbheight = $videoDetails['height']; } } }