File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
src/Chamilo/CoreBundle/Component/HTMLPurifier/Filter Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,22 @@ protected function postFilterCallback($matches)
63
63
64
64
$ youTubeMatch = preg_match ('#src="(https:)?//www.youtube(-nocookie)?.com/#i ' , $ matches [1 ]);
65
65
$ vimeoMatch = preg_match ('#://player.vimeo.com/#i ' , $ matches [1 ]);
66
+ $ googleMapsMatch = preg_match ('#src="https://maps.google.com/#i ' , $ matches [1 ]);
67
+ $ slideShare = preg_match ('#src="(https?:)?//www.slideshare.net/# ' , $ matches [1 ]);
68
+ $ geniallyMatch = preg_match ('#src="https://view.genially.com/#i ' , $ matches [1 ]);
69
+ $ platformDomain = preg_match ('#src="https?://(.+\.)? ' .$ hostName [1 ].'#i ' , $ matches [1 ]);
66
70
67
- if ($ youTubeMatch ) {
68
- $ extra .= ' allowfullscreen ' ;
69
- } elseif ($ vimeoMatch ) {
70
- $ extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen ' ;
71
+ if ($ youTubeMatch || $ vimeoMatch || $ googleMapsMatch || $ slideShare || $ geniallyMatch || $ platformDomain ) {
72
+ $ extra = ' frameborder="0" ' ;
73
+ if ($ youTubeMatch || $ geniallyMatch ) {
74
+ $ extra .= ' allowfullscreen ' ;
75
+ } elseif ($ vimeoMatch ) {
76
+ $ extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen ' ;
77
+ }
78
+
79
+ return '<iframe ' .$ matches [1 ].$ extra .'></iframe> ' ;
80
+ } else {
81
+ return '' ;
71
82
}
72
83
73
84
return '<iframe ' .$ matches [1 ].$ extra .'></iframe> ' ;
You can’t perform that action at this time.
0 commit comments