1: | <?php |
2: | /** |
3: | * TextSanitizer extension |
4: | * |
5: | * You may not change or alter any portion of this comment or credits |
6: | * of supporting developers from this source code or any supporting source code |
7: | * which is considered copyrighted (c) material of the original comment or credit authors. |
8: | * This program is distributed in the hope that it will be useful, |
9: | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10: | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11: | * |
12: | * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org) |
13: | * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html) |
14: | * @package class |
15: | * @subpackage textsanitizer |
16: | * @since 2.3.0 |
17: | * @author Taiwen Jiang <phppp@users.sourceforge.net> |
18: | */ |
19: | defined('XOOPS_ROOT_PATH') || exit('Restricted access'); |
20: | |
21: | /** |
22: | * Class MytsIframe |
23: | */ |
24: | class MytsIframe extends MyTextSanitizerExtension |
25: | { |
26: | /** |
27: | * @param MyTextSanitizer $myts |
28: | * |
29: | * @return bool |
30: | */ |
31: | public function load(MyTextSanitizer $myts) |
32: | { |
33: | $myts->patterns[] = "/\[iframe=(['\"]?)([^\"']*)\\1]([^\"]*)\[\/iframe\]/sU"; |
34: | $myts->replacements[] = "<iframe src='\\3' width='100%' height='\\2' scrolling='auto' frameborder='yes' marginwidth='0' marginheight='0' noresize></iframe>"; |
35: | |
36: | return true; |
37: | } |
38: | } |
39: |