diff options
| author | czaks <marcin@6irc.net> | 2013-07-22 10:14:17 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-07-22 10:14:17 -0400 |
| commit | 805c7298923a9d0ffe74ae3609fb69a23cd57bc3 (patch) | |
| tree | feb81d1d48c88a7448250247f2b77daa79fe82f5 /inc | |
| parent | e5663953b534f8098acff8f2942fdb81c2942acf (diff) | |
| parent | 51361d02fb4b66a198dcdb5cd6350e6dada0aac9 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/config.php | 3 | ||||
| -rw-r--r-- | inc/image.php | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/inc/config.php b/inc/config.php index 04ed6812..39c23c6f 100644 --- a/inc/config.php +++ b/inc/config.php @@ -426,6 +426,9 @@ $config['thumb_method'] = 'gd'; + // Strip EXIF metadata from JPEG files + $config['strip_exif'] = false; + // Regular expression to check for IE MIME type detection XSS exploit. To disable, comment the line out // https://github.com/savetheinternet/Tinyboard/issues/20 $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i'; diff --git a/inc/image.php b/inc/image.php index 8c9e380e..7aea9bfe 100644 --- a/inc/image.php +++ b/inc/image.php @@ -175,6 +175,9 @@ class ImageImagick extends ImageBase { } } public function to($src) { + if ($config['strip_exif']) { + $this->image->stripImage(); + } if (preg_match('/\.gif$/i', $src)) $this->image->writeImages($src, true); else @@ -245,9 +248,14 @@ class ImageConvert extends ImageBase { } } public function to($src) { + global $config; + if (!$this->temp) { - // $config['redraw_image'] - shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src)); + if ($config['strip_exif']) { + shell_exec('convert ' . escapeshellarg($this->src) . ' -strip ' . escapeshellarg($src)); + } else { + shell_exec('convert ' . escapeshellarg($this->src) . ' ' . escapeshellarg($src)); + } } else { rename($this->temp, $src); chmod($src, 0664); |
