mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 07:39:54 +02:00
MDL-19418 Fix up a couple of stray deprecated ereg and eregi_replace calls.
This commit is contained in:
parent
4a5a96b1e8
commit
355593f123
2 changed files with 6 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue