diff --git a/filter.php b/filter.php index d944a37..aab236b 100644 --- a/filter.php +++ b/filter.php @@ -119,6 +119,8 @@ public function filter($text, array $options = array()) { } $odburl = get_config('local_o365', 'odburl'); if (get_config('filter_oembed', 'o365video') && !empty($odburl)) { + $odburl = preg_replace('/^https?:\/\//', '', $odburl); + $odburl = preg_replace('/\/.*/', '', $odburl); $trimedurl = preg_replace("/-my/", "", $odburl); $search = '/]*href="(https?:\/\/)('.$odburl.'|'.$trimedurl.')\/(.*?)"(.*?)>(.*?)<\/a>/is'; $newtext = preg_replace_callback($search, 'filter_oembed_o365videocallback', $newtext);