From bdb3255116916a4a3e25c521ec307d2a2f91a05c Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 23 Feb 2014 22:27:52 +0000 Subject: [PATCH] speed: lowercase ext on image insert avoids having to lowercase every build_thumb_html call most extensions tend to match against their lowercase versions anyway --- core/basethemelet.class.php | 2 +- ext/image/main.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/basethemelet.class.php b/core/basethemelet.class.php index 06fadc20..445ada89 100644 --- a/core/basethemelet.class.php +++ b/core/basethemelet.class.php @@ -44,7 +44,7 @@ class BaseThemelet { $h_thumb_link = $image->get_thumb_link(); $h_tip = html_escape($image->get_tooltip()); $h_tags = strtolower($image->get_tag_list()); - $ext = strtolower($image->ext); + $ext = $image->ext; // If the file doesn't support thumbnail generation, show it at max size. if($ext === 'swf' || $ext === 'svg' || $ext === 'mp4' || $ext === 'ogv' || $ext === 'webm' || $ext === 'flv'){ diff --git a/ext/image/main.php b/ext/image/main.php index d2553606..4addd849 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -325,7 +325,7 @@ class ImageIO extends Extension { )", array( "owner_id"=>$user->id, "owner_ip"=>$_SERVER['REMOTE_ADDR'], "filename"=>substr($image->filename, 0, 60), "filesize"=>$image->filesize, - "hash"=>$image->hash, "ext"=>$image->ext, "width"=>$image->width, "height"=>$image->height, "source"=>$image->source + "hash"=>$image->hash, "ext"=>strtolower($image->ext), "width"=>$image->width, "height"=>$image->height, "source"=>$image->source ) ); $image->id = $database->get_last_insert_id('images_id_seq'); @@ -435,7 +435,7 @@ class ImageIO extends Extension { ", array( "filename"=>$image->filename, "filesize"=>$image->filesize, "hash"=>$image->hash, - "ext"=>$image->ext, "width"=>$image->width, "height"=>$image->height, "source"=>$image->source, + "ext"=>strtolower($image->ext), "width"=>$image->width, "height"=>$image->height, "source"=>$image->source, "id"=>$id ) );