From d1aebae82e1e45bc74bdd717df01b95484e30595 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 23 May 2004 18:20:50 +0000 Subject: [PATCH] Now only integers < 1000 are avoided... Bug 1441 (http://moodle.org/bugs/bug.php?op=show&bugid=1441) --- mod/resource/filter.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/resource/filter.php b/mod/resource/filter.php index 0112963fd7..03c57669a5 100644 --- a/mod/resource/filter.php +++ b/mod/resource/filter.php @@ -54,8 +54,9 @@ $href_tag_begin = "wwwroot/mod/resource/view.php?id=$cm->id\">"; $currentname = $resource->name; if ($currentname = trim($currentname)) { - //Only if the term is >2 lenght - if (strlen($currentname) >2) { + //Avoid integers < 1000 to be linked. See bug 1441. + $intcurrent = intval($currentname); + if (!(!empty($intcurrent) && strval($intcurrent) == $currentname && $intcurrent < 1000)) { $text = resource_link_names($text,$currentname,$href_tag_begin, ""); } } @@ -72,7 +73,7 @@ $list_of_words_cp = trim($list_of_words_cp); - $list_of_words_cp = preg_quote($list_of_words_cp); + $list_of_words_cp = preg_quote($list_of_words_cp,'/'); $invalidprefixs = "([a-zA-Z0-9])"; $invalidsufixs = "([a-zA-Z0-9])"; -- 2.39.5