MINOR Remove use of deprecated ereg_replace() and use preg_replace() instead.

This commit is contained in:
Sean Harvey 2012-03-27 22:52:33 +13:00
parent 8166c26a8f
commit 1ab76865ea

View File

@ -102,8 +102,8 @@ class FilesystemPublisher extends StaticPublisher {
// perform similar transformations to SiteTree::generateURLSegment() // perform similar transformations to SiteTree::generateURLSegment()
$urlSegment = str_replace('&','-and-',$urlSegment); $urlSegment = str_replace('&','-and-',$urlSegment);
$urlSegment = str_replace('&','-and-',$urlSegment); $urlSegment = str_replace('&','-and-',$urlSegment);
$urlSegment = ereg_replace('[^A-Za-z0-9\/-]+','-',$urlSegment); $urlSegment = preg_replace('/[^A-Za-z0-9\/-]+/', '-', $urlSegment);
$urlSegment = ereg_replace('-+','-',$urlSegment); $urlSegment = preg_replace('/-+/', '-', $urlSegment);
$urlSegment = trim($urlSegment, '/'); $urlSegment = trim($urlSegment, '/');
$filename = $urlSegment ? "$urlSegment.$this->fileExtension" : "index.$this->fileExtension"; $filename = $urlSegment ? "$urlSegment.$this->fileExtension" : "index.$this->fileExtension";