Browse files

MDL-19418 Fix up a couple of stray deprecated ereg and eregi_replace …

…calls.
  • Loading branch information...
1 parent 4a5a96b commit 355593f123654aa209d682b45ea7e6a32933a9eb @doctorlard doctorlard committed Jul 20, 2010
Showing with 6 additions and 7 deletions.
  1. +2 −2 auth/shibboleth/README.txt
  2. +4 −5 lib/simpletest/testweblib.php
View
4 auth/shibboleth/README.txt
@@ -213,10 +213,10 @@ Example file:
// institution, street, zipcode, city and country
$address = $_SERVER[$this->config->field_map_address];
list($institution, $street, $zip_city) = explode('$', $address);
- ereg(' (.+)',$zip_city, $regs);
+ preg_match('/ (.+)/', $zip_city, $regs);
$city = $regs[1];
- ereg('(.+)-',$zip_city, $regs);
+ preg_match('/(.+)-/',$zip_city, $regs);
$country = $regs[1];
$result["address"] = $street;
View
9 lib/simpletest/testweblib.php
@@ -117,12 +117,11 @@ function test_compare_url() {
function old_convert_urls_into_links(&$text) {
/// Make lone URLs into links. eg http://moodle.com/
- $text = eregi_replace("([[:space:]]|^|\(|\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])",
- "\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>", $text);
-
+ $text = preg_replace("%([[:space:]]|^|\(|\[)([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])%i",
+ '$1<a href="$2://$3$4" target="_blank">$2://$3$4</a>', $text);
/// eg www.moodle.com
- $text = eregi_replace("([[:space:]]|^|\(|\[)www\.([^[:space:]]*)([[:alnum:]#?/&=])",
- "\\1<a href=\"http://www.\\2\\3\" target=\"_blank\">www.\\2\\3</a>", $text);
+ $text = preg_replace("%([[:space:]]|^|\(|\[)www\.([^[:space:]]*)([[:alnum:]#?/&=])%i",
+ '$1<a href="http://www.$2$3" target="_blank">www.$2$3</a>', $text);
}
function get_test_text(){

0 comments on commit 355593f

Please sign in to comment.