MDL-19418 Replaced ereg* by preg*

This commit is contained in:
nicolasconnault
2009-06-22 01:22:37 +00:00
parent c20b684517
commit 6dbcaceef1
36 changed files with 183 additions and 165 deletions
+2 -2
View File
@@ -423,7 +423,7 @@ class qformat_default {
$filearray = file($filename);
/// Check for Macintosh OS line returns (ie file on one line), and fix
if (ereg("\r", $filearray[0]) AND !ereg("\n", $filearray[0])) {
if (preg_match("~\r~", $filearray[0]) AND !preg_match("~\n~", $filearray[0])) {
return explode("\r", $filearray[0]);
} else {
return $filearray;
@@ -572,7 +572,7 @@ class qformat_default {
fclose( $fh );
// return the (possibly) new filename
$newfile = ereg_replace("{$CFG->dataroot}/{$this->course->id}/", '',$newfullpath);
$newfile = preg_replace("~{$CFG->dataroot}/{$this->course->id}/~", '',$newfullpath);
return $newfile;
}