From 1ab76865eae00d41f63f9dcc71035f683c8f48b1 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 27 Mar 2012 22:52:33 +1300 Subject: [PATCH] MINOR Remove use of deprecated ereg_replace() and use preg_replace() instead. --- code/staticpublisher/FilesystemPublisher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/staticpublisher/FilesystemPublisher.php b/code/staticpublisher/FilesystemPublisher.php index 2f1809f9..4de5dcda 100644 --- a/code/staticpublisher/FilesystemPublisher.php +++ b/code/staticpublisher/FilesystemPublisher.php @@ -102,8 +102,8 @@ class FilesystemPublisher extends StaticPublisher { // perform similar transformations to SiteTree::generateURLSegment() $urlSegment = str_replace('&','-and-',$urlSegment); $urlSegment = str_replace('&','-and-',$urlSegment); - $urlSegment = ereg_replace('[^A-Za-z0-9\/-]+','-',$urlSegment); - $urlSegment = ereg_replace('-+','-',$urlSegment); + $urlSegment = preg_replace('/[^A-Za-z0-9\/-]+/', '-', $urlSegment); + $urlSegment = preg_replace('/-+/', '-', $urlSegment); $urlSegment = trim($urlSegment, '/'); $filename = $urlSegment ? "$urlSegment.$this->fileExtension" : "index.$this->fileExtension";