Permalink
Browse files

Fixing drift between CVS and git

  • Loading branch information...
Moodle HQ git importer
Moodle HQ git importer committed Nov 23, 2009
1 parent dcb7585 commit 2b7cefa2f55f3c736d0c4fd494c498feddf2d171
@@ -15,7 +15,7 @@
#-- stupid legacy code
-if (!preg_match("/modules.php/i", $PHP_SELF)) {
+if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
View
@@ -1569,11 +1569,11 @@ function wiki_admin_checklinks($pagetocheck) {
}
/// Remove old Notices
- $content = preg_replace('/ µµ__~\['.get_string("offline","wiki").'\]__µµ /i','', $content);
+ $content = eregi_replace(' µµ__~\['.get_string("offline","wiki").'\]__µµ ','', $content);
#-- replace dead links
foreach ($badlinks as $href) {
- $content = preg_replace("/\377^(.*)($href)\377m", '$1 µµ__~['.get_string("offline","wiki").']__µµ $2/', $content);
+ $content = preg_replace("\377^(.*)($href)\377m", '$1 µµ__~['.get_string("offline","wiki").']__µµ $2', $content);
}
#-- compare against db content
View
@@ -21,10 +21,10 @@ function makesafe($param) {
$param = str_replace('\\\'', '\'', $param);
$param = str_replace('\\"', '"', $param);
$param = str_replace('\\', '/', $param);
- $param = preg_replace('/[[:cntrl:]]|[<>"`\|\':]/', '', $param);
- $param = preg_replace('/\.\.+/', '', $param);
- $param = preg_replace('#//+#', '/', $param);
- return preg_replace('#/(\./)+#', '/', $param);
+ $param = ereg_replace('[[:cntrl:]]|[<>"`\|\':]', '', $param);
+ $param = ereg_replace('\.\.+', '', $param);
+ $param = ereg_replace('//+', '/', $param);
+ return ereg_replace('/(\./)+', '/', $param);
}
// Nicked from weblib
View
@@ -438,7 +438,7 @@ function readdata($filename) {
$filearray = file($filename);
/// Check for Macintosh OS line returns (ie file on one line), and fix
- if (preg_match("/\r/", $filearray[0]) AND !preg_match("/\n/", $filearray[0])) {
+ if (ereg("\r", $filearray[0]) AND !ereg("\n", $filearray[0])) {
return explode("\r", $filearray[0]);
} else {
return $filearray;
@@ -583,7 +583,7 @@ function importimagefile( $path, $base64 ) {
fclose( $fh );
// return the (possibly) new filename
- $newfile = preg_replace("#{$CFG->dataroot}/{$this->course->id}/#", '',$newfullpath);
+ $newfile = ereg_replace("{$CFG->dataroot}/{$this->course->id}/", '',$newfullpath);
return $newfile;
}
@@ -119,7 +119,7 @@ function readquestion($lines) {
$question = $this->defaultquestion();
$comment = NULL;
// define replaced by simple assignment, stop redefine notices
- $gift_answerweight_regex = "/^%\-*([0-9]{1,2})\.?([0-9]*)%/";
+ $gift_answerweight_regex = "^%\-*([0-9]{1,2})\.?([0-9]*)%";
// REMOVED COMMENTED LINES and IMPLODE
foreach ($lines as $key => $line) {
@@ -139,7 +139,7 @@ function readquestion($lines) {
$text = $this->escapedchar_pre($text);
// Look for category modifier
- if (preg_match( '/^\$CATEGORY:/', $text)) {
+ if (ereg( '^\$CATEGORY:', $text)) {
// $newcategory = $matches[1];
$newcategory = trim(substr( $text, 10 ));
@@ -317,7 +317,7 @@ function readquestion($lines) {
$answer_weight = 1;
$answer = substr($answer, 1);
- } elseif (preg_match($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
+ } elseif (ereg($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
$answer_weight = $this->answerweightparser($answer);
} else { //default, i.e., wrong anwer
@@ -408,7 +408,7 @@ function readquestion($lines) {
$answer = trim($answer);
// Answer Weight
- if (preg_match($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
+ if (ereg($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
$answer_weight = $this->answerweightparser($answer);
} else { //default, i.e., full-credit anwer
$answer_weight = 1;
@@ -456,7 +456,7 @@ function readquestion($lines) {
$answer = trim($answer);
// Answer weight
- if (preg_match($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
+ if (ereg($gift_answerweight_regex, $answer)) { // check for properly formatted answer weight
$answer_weight = $this->answerweightparser($answer);
} else { //default, i.e., full-credit anwer
$answer_weight = 1;
@@ -33,8 +33,8 @@ function indent_xhtml($source, $indenter = ' ') {
// Remove all tabs.
$source = str_replace("\t", '', $source);
// Remove all space after ">" and before "<".
- $source = preg_replace("/>( )*/", ">", $source);
- $source = preg_replace("/( )*</", "<", $source);
+ $source = ereg_replace(">( )*", ">", $source);
+ $source = ereg_replace("( )*<", "<", $source);
// Iterate through the source.
$level = 0;
Oops, something went wrong.

0 comments on commit 2b7cefa

Please sign in to comment.