From b6b0b73100fdd8d5e761bd2ce85d33e8d0cc1dfc Mon Sep 17 00:00:00 2001 From: Paal Braathen Date: Thu, 5 Jan 2012 19:40:48 +0100 Subject: [PATCH] Fiksa renameing x2 da det er skrevet mongokode flere plasser --- inside/Concert.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inside/Concert.php b/inside/Concert.php index 113109c..3702dbe 100644 --- a/inside/Concert.php +++ b/inside/Concert.php @@ -142,8 +142,9 @@ class Concert { $this->id = getNextId("program"); if($_FILES['userfile']['error'] != 4){ $temp_name = new_file($_FILES['userfile'], "program"); - rename_file($temp_name, $this->id, "program"); - $this->picture = $this->id.substr($temp_name, -4); + rename_file($temp_name, $this->id, "program"); + $ext = strtolower( pathinfo($temp_name, PATHINFO_EXTENSION) ); + $this->picture = $this->id . "." . $ext; } else { $this->picture = "0"; }