Small optimization
authorMarcel Werk <burntime@woltlab.com>
Fri, 26 Apr 2013 13:43:23 +0000 (15:43 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 26 Apr 2013 13:43:23 +0000 (15:43 +0200)
wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php
wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php
wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php

index 8ee4348547cd4a1417b455aa301b643d42883d0a..f1b3dbdcca4b7f39c3635b4e47fbcf1149e27b93 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 namespace wcf\acp\form;
-use wcf\system\exception\IllegalLinkException;
-
 use wcf\data\template\group\TemplateGroup;
 use wcf\data\template\group\TemplateGroupAction;
 use wcf\data\template\group\TemplateGroupList;
index 3cc01ad05840e816d8d9f0732cdcccf4e8447db7..0c07cfb80594705c38fa3dd52a123edcabda6215 100644 (file)
@@ -32,8 +32,7 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                        // build sql string with ACP-templateNames
                        $fileNames = array();
                        foreach ($files as $file) {
-                               $fileName = preg_replace("~\.tpl$~", "", $file);
-                               $fileNames[] = $fileName;
+                               $fileNames[] = substr($file, 0, -4);
                        }
                        
                        // check if files are existing already
@@ -76,7 +75,7 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                
                // remove file extension
                foreach ($files as &$file) {
-                       $file = preg_replace('~.tpl$~', '', $file);
+                       $file = substr($file, 0, -4);
                }
                unset($file);
                
index 3697cb651d6037a9449b3ee4ebf5a883a4d52c19..82e7a72fa3aaf3c3b6d26407752c2311bb71b950 100644 (file)
@@ -27,7 +27,7 @@ class TemplatesFileHandler extends ACPTemplatesFileHandler {
        
                // remove file extension
                foreach ($files as &$file) {
-                       $file = preg_replace('~.tpl$~', '', $file);
+                       $file = substr($file, 0, -4);
                }
                unset($file);