File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
src/Chamilo/CoreBundle/Component/HTMLPurifier/Filter Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -59,24 +59,16 @@ protected function postFilterCallback($matches)
5959 // Domain Whitelist
6060 $ hostName = [];
6161 preg_match ('#https?://(.*)#i ' , api_get_path (WEB_PATH ), $ hostName );
62+ $ extra = ' frameborder="0" ' ;
6263
6364 $ youTubeMatch = preg_match ('#src="(https:)?//www.youtube(-nocookie)?.com/#i ' , $ matches [1 ]);
6465 $ vimeoMatch = preg_match ('#://player.vimeo.com/#i ' , $ matches [1 ]);
65- $ googleMapsMatch = preg_match ('#src="https://maps.google.com/#i ' , $ matches [1 ]);
66- $ slideShare = preg_match ('#src="(https?:)?//www.slideshare.net/# ' , $ matches [1 ]);
67- $ platformDomain = preg_match ('#src="https?://(.+\.)? ' .$ hostName [1 ].'#i ' , $ matches [1 ]);
6866
69- if ($ youTubeMatch || $ vimeoMatch || $ googleMapsMatch || $ slideShare || $ platformDomain ) {
70- $ extra = ' frameborder="0" ' ;
71- if ($ youTubeMatch ) {
72- $ extra .= ' allowfullscreen ' ;
73- } elseif ($ vimeoMatch ) {
74- $ extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen ' ;
75- }
76-
77- return '<iframe ' .$ matches [1 ].$ extra .'></iframe> ' ;
78- } else {
79- return '' ;
67+ if ($ youTubeMatch ) {
68+ $ extra .= ' allowfullscreen ' ;
69+ } elseif ($ vimeoMatch ) {
70+ $ extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen ' ;
8071 }
72+ return '<iframe ' .$ matches [1 ].$ extra .'></iframe> ' ;
8173 }
8274}
You can’t perform that action at this time.
0 commit comments