Commit 817e3a80 authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

Fix A tag regex searching in book. MDL-15842 ; merged from 19_STABLE

parent 7ac78b92
<?PHP // $Id: lib.php,v 1.4 2008/07/23 14:03:49 skodak Exp $
<?PHP // $Id: lib.php,v 1.5 2008/07/26 22:58:27 stronk7 Exp $
define('NUM_NONE', '0');
define('NUM_NUMBERS', '1');
......@@ -415,7 +415,7 @@ function book_relink($id, $bookid, $courseid) {
}
}
//relative link conversion
if ($ch->importsrc && preg_match_all('/(<a[^>]+href=")([^"^#]*)(#[^"]*)?("[^>]*>)/i', $ch->content, $links)) {
if ($ch->importsrc && preg_match_all('/(<a\s[^>]*href=")([^"^#]*)(#[^"]*)?("[^>]*>)/i', $ch->content, $links)) {
for($i = 0; $i<count($links[0]); $i++) {
if ($links[2][$i] != '' //check for inner anchor links
&& !preg_match('/[a-z]+:/i', $links[2][$i])) { //not absolute link
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment