Skip to content

Commit

Permalink
MDL-19418 Fix up a couple of stray deprecated ereg and eregi_replace …
Browse files Browse the repository at this point in the history
…calls.
  • Loading branch information
doctorlard committed Jul 20, 2010
1 parent 4a5a96b commit 355593f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions auth/shibboleth/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions lib/simpletest/testweblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down

0 comments on commit 355593f

Please sign in to comment.