From 7de75919aceeb24e816a0af9f300cd46f7b6ee0d Mon Sep 17 00:00:00 2001 From: Andreas Piening Date: Fri, 5 Feb 2010 01:17:56 +0000 Subject: [PATCH] MINOR: fixed setName() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98282 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/File.php b/filesystem/File.php index 3e3cb4fa7..3aa9e5ed8 100755 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -310,7 +310,7 @@ class File extends DataObject { $name = ereg_replace(' +','-',trim($name)); $name = ereg_replace('[^A-Za-z0-9.+_\-]','',$name); - while($name[0] == '_' || $name[0] == '.') { + while(!empty($name) && ($name[0] == '_' || $name[0] == '.')) { $name = substr($name, 1); }