MINOR: fixed setName()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98282 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andreas Piening 2010-02-05 01:17:56 +00:00 committed by Sam Minnee
parent 13c8b89310
commit 7de75919ac

View File

@ -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);
}