From 6646fbb9de61d5a2e4b8c4b3d609919c0241d51a Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 25 Sep 2007 05:49:51 +0200 Subject: [PATCH] [svn r13234] Improvements to external media detection in get_resources_from_source() --- main/newscorm/learnpathItem.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index b8afe2b531..226228d0eb 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -558,7 +558,8 @@ class learnpathItem{ if(strpos($source,"+this.")) continue; //javascript code - will still work unaltered if(!strpos($source,'.')) continue; //no dot, should not be an external file anyway if(strpos($source,'mailto:')) continue; //mailto link - if(strpos($source,';')) continue; //avoid code - that should help + if(strpos($source,';') && !strpos($source,'&')) continue; //avoid code - that should help + if($attr == 'value') { if(strpos($source , 'mp3file')) @@ -573,6 +574,8 @@ class learnpathItem{ } if(strpos($source,'://') > 0) { + //cut at '?' in a URL with params + if(strpos($source,'?')>0){$source = substr($source,0,strpos($source,'?'));} //found some protocol there if(strpos($source,api_get_path(WEB_PATH))!==false) {