mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: fixed setName() (from r98282)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102640 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c5fda512d6
commit
2978728265
@ -310,7 +310,7 @@ class File extends DataObject {
|
|||||||
$name = ereg_replace(' +','-',trim($name));
|
$name = ereg_replace(' +','-',trim($name));
|
||||||
$name = ereg_replace('[^A-Za-z0-9.+_\-]','',$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);
|
$name = substr($name, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user