diff --git a/filter.php b/filter.php index 617e786..855d497 100644 --- a/filter.php +++ b/filter.php @@ -80,8 +80,9 @@ function filter_generico_callback(array $link){ //we use this to see if its a web service calling this, //in which case we return the alternate content + $climode = defined('CLI_SCRIPT') && CLI_SCRIPT; $is_webservice = false; - if(property_exists($PAGE, 'url')){ + if(!$climode){ $is_webservice = strpos($PAGE->url,$CFG->wwwroot .'/webservice/') === 0; } @@ -413,7 +414,7 @@ function filter_generico_callback(array $link){ $require_amd = $conf['template_amd_' . $tempindex] && $CFG->version>=2015051100; //figure out if this is https or http. We don't want to scare the browser - if(property_exists($PAGE, 'url') && strpos($PAGE->url->out(),'https:')===0){ + if(!$climode && strpos($PAGE->url->out(),'https:')===0){ $scheme='https:'; }else{ $scheme='http:';