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

This commit is contained in:
Jonathan Harker 2010-07-20 06:13:18 +00:00
parent 4a5a96b1e8
commit 355593f123
2 changed files with 6 additions and 7 deletions

View file

@ -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 file

@ -117,12 +117,11 @@ class web_test extends UnitTestCase {
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(){