@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | |
12 | 12 | $config = phorum_htmlpurifier_get_config(); |
13 | 13 | |
14 | - $frm = new PhorumInputForm ("", "post", "Save"); |
|
14 | + $frm = new PhorumInputForm("", "post", "Save"); |
|
15 | 15 | $frm->hidden("module", "modsettings"); |
16 | 16 | $frm->hidden("mod", "htmlpurifier"); // this is the directory name that the Settings file lives in |
17 | 17 | |
18 | - if (!empty($error)){ |
|
18 | + if (!empty($error)) { |
|
19 | 19 | echo "$error<br />"; |
20 | 20 | } |
21 | 21 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | When checked, contents sent for edit are now purified and the |
26 | 26 | informative message is disabled. If your WYSIWYG editor is disabled for |
27 | 27 | admin edits, you can safely keep this unchecked.</p>'); |
28 | - $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg'])); |
|
28 | + $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM[ 'mod_htmlpurifier' ][ 'wysiwyg' ])); |
|
29 | 29 | |
30 | 30 | $frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'suppress_message\']</code>, |
31 | 31 | which removes the big how-to use |
32 | 32 | HTML Purifier message.</p>'); |
33 | - $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message'])); |
|
33 | + $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM[ 'mod_htmlpurifier' ][ 'suppress_message' ])); |
|
34 | 34 | |
35 | 35 | $frm->addMessage('<p>Click on directive links to read what each option does |
36 | 36 | (links do not open in new windows).</p> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $htmlpurifier_form->setTextareaDimensions(23, 7); // widen a little, since we have space |
45 | 45 | |
46 | 46 | $frm->addMessage($htmlpurifier_form->render( |
47 | - $config, $PHORUM['mod_htmlpurifier']['directives'], false)); |
|
47 | + $config, $PHORUM[ 'mod_htmlpurifier' ][ 'directives' ], false)); |
|
48 | 48 | |
49 | 49 | $frm->addMessage("<strong>Warning: Changing HTML Purifier's configuration will invalidate |
50 | 50 | the cache. Expect to see a flurry of database activity after you change |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false)); |
54 | 54 | |
55 | 55 | // hack to include extra styling |
56 | - echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . ' |
|
56 | + echo '<style type="text/css">'.$htmlpurifier_form->getCSS().' |
|
57 | 57 | .hp-config {margin-left:auto;margin-right:auto;} |
58 | 58 | </style>'; |
59 | 59 | $js = $htmlpurifier_form->getJavaScript(); |
@@ -4,16 +4,16 @@ discard block |
||
4 | 4 | { |
5 | 5 | global $PHORUM; |
6 | 6 | $offset = 0; |
7 | - if (!empty($_POST['migrate-sigs'])) { |
|
8 | - if (!isset($_POST['confirmation']) || strtolower($_POST['confirmation']) !== 'yes') { |
|
7 | + if (!empty($_POST[ 'migrate-sigs' ])) { |
|
8 | + if (!isset($_POST[ 'confirmation' ]) || strtolower($_POST[ 'confirmation' ]) !== 'yes') { |
|
9 | 9 | echo 'Invalid confirmation code.'; |
10 | 10 | exit; |
11 | 11 | } |
12 | - $PHORUM['mod_htmlpurifier']['migrate-sigs'] = true; |
|
13 | - phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"])); |
|
12 | + $PHORUM[ 'mod_htmlpurifier' ][ 'migrate-sigs' ] = true; |
|
13 | + phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM[ "mod_htmlpurifier" ])); |
|
14 | 14 | $offset = 1; |
15 | - } elseif (!empty($_GET['migrate-sigs']) && $PHORUM['mod_htmlpurifier']['migrate-sigs']) { |
|
16 | - $offset = (int) $_GET['migrate-sigs']; |
|
15 | + } elseif (!empty($_GET[ 'migrate-sigs' ]) && $PHORUM[ 'mod_htmlpurifier' ][ 'migrate-sigs' ]) { |
|
16 | + $offset = (int) $_GET[ 'migrate-sigs' ]; |
|
17 | 17 | } |
18 | 18 | return $offset; |
19 | 19 | } |
@@ -22,32 +22,32 @@ discard block |
||
22 | 22 | { |
23 | 23 | global $PHORUM; |
24 | 24 | |
25 | - if(!$offset) return; // bail out quick if $offset == 0 |
|
25 | + if (!$offset) return; // bail out quick if $offset == 0 |
|
26 | 26 | |
27 | 27 | // theoretically, we could get rid of this multi-request |
28 | 28 | // doo-hickery if safe mode is off |
29 | 29 | @set_time_limit(0); // attempt to let this run |
30 | - $increment = $PHORUM['mod_htmlpurifier']['migrate-sigs-increment']; |
|
30 | + $increment = $PHORUM[ 'mod_htmlpurifier' ][ 'migrate-sigs-increment' ]; |
|
31 | 31 | |
32 | - require_once(dirname(__FILE__) . '/../migrate.php'); |
|
32 | + require_once(dirname(__FILE__).'/../migrate.php'); |
|
33 | 33 | // migrate signatures |
34 | 34 | // do this in batches so we don't run out of time/space |
35 | 35 | $end = $offset + $increment; |
36 | 36 | $user_ids = array(); |
37 | 37 | for ($i = $offset; $i < $end; $i++) { |
38 | - $user_ids[] = $i; |
|
38 | + $user_ids[ ] = $i; |
|
39 | 39 | } |
40 | 40 | $userinfos = phorum_db_user_get_fields($user_ids, 'signature'); |
41 | 41 | foreach ($userinfos as $i => $user) { |
42 | - if (empty($user['signature'])) continue; |
|
43 | - $sig = $user['signature']; |
|
42 | + if (empty($user[ 'signature' ])) continue; |
|
43 | + $sig = $user[ 'signature' ]; |
|
44 | 44 | // perform standard Phorum processing on the sig |
45 | - $sig = str_replace(array("&","<",">"), array("&","<",">"), $sig); |
|
45 | + $sig = str_replace(array("&", "<", ">"), array("&", "<", ">"), $sig); |
|
46 | 46 | $sig = preg_replace("/<((http|https|ftp):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%]+?)>/i", "$1", $sig); |
47 | 47 | // prepare fake data to pass to migration function |
48 | 48 | $fake_data = array(array("author"=>"", "email"=>"", "subject"=>"", 'body' => $sig)); |
49 | 49 | list($fake_message) = phorum_htmlpurifier_migrate($fake_data); |
50 | - $user['signature'] = $fake_message['body']; |
|
50 | + $user[ 'signature' ] = $fake_message[ 'body' ]; |
|
51 | 51 | if (!phorum_api_user_save($user)) { |
52 | 52 | exit('Error while saving user data'); |
53 | 53 | } |
@@ -55,21 +55,21 @@ discard block |
||
55 | 55 | unset($userinfos); // free up memory |
56 | 56 | |
57 | 57 | // query for highest ID in database |
58 | - $type = $PHORUM['DBCONFIG']['type']; |
|
59 | - $sql = "select MAX(user_id) from {$PHORUM['user_table']}"; |
|
58 | + $type = $PHORUM[ 'DBCONFIG' ][ 'type' ]; |
|
59 | + $sql = "select MAX(user_id) from {$PHORUM[ 'user_table' ]}"; |
|
60 | 60 | $row = phorum_db_interact(DB_RETURN_ROW, $sql); |
61 | - $top_id = (int) $row[0]; |
|
61 | + $top_id = (int) $row[ 0 ]; |
|
62 | 62 | |
63 | 63 | $offset += $increment; |
64 | 64 | if ($offset > $top_id) { // test for end condition |
65 | 65 | echo 'Migration finished'; |
66 | - $PHORUM['mod_htmlpurifier']['migrate-sigs'] = false; |
|
66 | + $PHORUM[ 'mod_htmlpurifier' ][ 'migrate-sigs' ] = false; |
|
67 | 67 | phorum_htmlpurifier_commit_settings(); |
68 | 68 | return true; |
69 | 69 | } |
70 | - $host = $_SERVER['HTTP_HOST']; |
|
71 | - $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); |
|
72 | - $extra = 'admin.php?module=modsettings&mod=htmlpurifier&migrate-sigs=' . $offset; |
|
70 | + $host = $_SERVER[ 'HTTP_HOST' ]; |
|
71 | + $uri = rtrim(dirname($_SERVER[ 'PHP_SELF' ]), '/\\'); |
|
72 | + $extra = 'admin.php?module=modsettings&mod=htmlpurifier&migrate-sigs='.$offset; |
|
73 | 73 | // relies on output buffering to work |
74 | 74 | header("Location: http://$host$uri/$extra"); |
75 | 75 | exit; |
@@ -22,7 +22,10 @@ discard block |
||
22 | 22 | { |
23 | 23 | global $PHORUM; |
24 | 24 | |
25 | - if(!$offset) return; // bail out quick if $offset == 0 |
|
25 | + if(!$offset) { |
|
26 | + return; |
|
27 | + } |
|
28 | + // bail out quick if $offset == 0 |
|
26 | 29 | |
27 | 30 | // theoretically, we could get rid of this multi-request |
28 | 31 | // doo-hickery if safe mode is off |
@@ -39,7 +42,9 @@ discard block |
||
39 | 42 | } |
40 | 43 | $userinfos = phorum_db_user_get_fields($user_ids, 'signature'); |
41 | 44 | foreach ($userinfos as $i => $user) { |
42 | - if (empty($user['signature'])) continue; |
|
45 | + if (empty($user['signature'])) { |
|
46 | + continue; |
|
47 | + } |
|
43 | 48 | $sig = $user['signature']; |
44 | 49 | // perform standard Phorum processing on the sig |
45 | 50 | $sig = str_replace(array("&","<",">"), array("&","<",">"), $sig); |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | settings, edit that file. To use the web form, delete that file.<br />"; |
9 | 9 | } else { |
10 | 10 | $config = phorum_htmlpurifier_get_config(true); |
11 | - if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); |
|
12 | - $PHORUM['mod_htmlpurifier']['config'] = $config->getAll(); |
|
11 | + if (!isset($_POST[ 'reset' ])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM[ 'mod_htmlpurifier' ][ 'directives' ]); |
|
12 | + $PHORUM[ 'mod_htmlpurifier' ][ 'config' ] = $config->getAll(); |
|
13 | 13 | } |
14 | - $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']); |
|
15 | - $PHORUM['mod_htmlpurifier']['suppress_message'] = !empty($_POST['suppress_message']); |
|
16 | - if(!phorum_htmlpurifier_commit_settings()){ |
|
17 | - $error="Database error while updating settings."; |
|
14 | + $PHORUM[ 'mod_htmlpurifier' ][ 'wysiwyg' ] = !empty($_POST[ 'wysiwyg' ]); |
|
15 | + $PHORUM[ 'mod_htmlpurifier' ][ 'suppress_message' ] = !empty($_POST[ 'suppress_message' ]); |
|
16 | + if (!phorum_htmlpurifier_commit_settings()) { |
|
17 | + $error = "Database error while updating settings."; |
|
18 | 18 | } else { |
19 | 19 | echo "Settings Updated<br />"; |
20 | 20 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function phorum_htmlpurifier_commit_settings() |
24 | 24 | { |
25 | 25 | global $PHORUM; |
26 | - return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"])); |
|
26 | + return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM[ "mod_htmlpurifier" ])); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // vim: et sw=4 sts=4 |
@@ -8,7 +8,9 @@ |
||
8 | 8 | settings, edit that file. To use the web form, delete that file.<br />"; |
9 | 9 | } else { |
10 | 10 | $config = phorum_htmlpurifier_get_config(true); |
11 | - if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); |
|
11 | + if (!isset($_POST['reset'])) { |
|
12 | + $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); |
|
13 | + } |
|
12 | 14 | $PHORUM['mod_htmlpurifier']['config'] = $config->getAll(); |
13 | 15 | } |
14 | 16 | $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | function phorum_htmlpurifier_show_migrate_sigs_form() |
4 | 4 | { |
5 | - $frm = new PhorumInputForm ('', "post", "Migrate"); |
|
5 | + $frm = new PhorumInputForm('', "post", "Migrate"); |
|
6 | 6 | $frm->hidden("module", "modsettings"); |
7 | 7 | $frm->hidden("mod", "htmlpurifier"); |
8 | 8 | $frm->hidden("migrate-sigs", "1"); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $frm->addMessage('This operation will migrate your users signatures |
11 | 11 | to HTML. <strong>This process is irreversible and must only be performed once.</strong> |
12 | 12 | Type in yes in the confirmation field to migrate.'); |
13 | - if (!file_exists(dirname(__FILE__) . '/../migrate.php')) { |
|
13 | + if (!file_exists(dirname(__FILE__).'/../migrate.php')) { |
|
14 | 14 | $frm->addMessage('Migration file does not exist, cannot migrate signatures. |
15 | 15 | Please check <tt>migrate.bbcode.php</tt> on how to create an appropriate file.'); |
16 | 16 | } else { |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | // default HTML Purifier configuration settings |
6 | 6 | $config->set('HTML.Allowed', |
7 | - // alphabetically sorted |
|
7 | + // alphabetically sorted |
|
8 | 8 | 'a[href|title] |
9 | 9 | abbr[title] |
10 | 10 | acronym[title] |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $config->set('Core.AggressivelyFixLt', true); |
52 | 52 | $config->set('Core.Encoding', $GLOBALS['PHORUM']['DATA']['CHARSET']); // we'll change this eventually |
53 | 53 | if (strtolower($GLOBALS['PHORUM']['DATA']['CHARSET']) !== 'utf-8') { |
54 | - $config->set('Core.EscapeNonASCIICharacters', true); |
|
54 | + $config->set('Core.EscapeNonASCIICharacters', true); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | // vim: et sw=4 sts=4 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined("PHORUM")) exit; |
|
3 | +if (!defined("PHORUM")) exit; |
|
4 | 4 | |
5 | 5 | // default HTML Purifier configuration settings |
6 | 6 | $config->set('HTML.Allowed', |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | $config->set('AutoFormat.Linkify', true); |
50 | 50 | $config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); |
51 | 51 | $config->set('Core.AggressivelyFixLt', true); |
52 | -$config->set('Core.Encoding', $GLOBALS['PHORUM']['DATA']['CHARSET']); // we'll change this eventually |
|
53 | -if (strtolower($GLOBALS['PHORUM']['DATA']['CHARSET']) !== 'utf-8') { |
|
52 | +$config->set('Core.Encoding', $GLOBALS[ 'PHORUM' ][ 'DATA' ][ 'CHARSET' ]); // we'll change this eventually |
|
53 | +if (strtolower($GLOBALS[ 'PHORUM' ][ 'DATA' ][ 'CHARSET' ]) !== 'utf-8') { |
|
54 | 54 | $config->set('Core.EscapeNonASCIICharacters', true); |
55 | 55 | } |
56 | 56 |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined("PHORUM")) exit; |
|
3 | +if(!defined("PHORUM")) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | // default HTML Purifier configuration settings |
6 | 8 | $config->set('HTML.Allowed', |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | * by creating a 'config.php' file. |
10 | 10 | */ |
11 | 11 | |
12 | -if(!defined("PHORUM_ADMIN")) exit; |
|
12 | +if (!defined("PHORUM_ADMIN")) exit; |
|
13 | 13 | |
14 | 14 | // error reporting is good! |
15 | 15 | error_reporting(E_ALL ^ E_NOTICE); |
16 | 16 | |
17 | 17 | // load library and other paraphenalia |
18 | 18 | require_once './include/admin/PhorumInputForm.php'; |
19 | -require_once (dirname(__FILE__) . '/htmlpurifier/HTMLPurifier.auto.php'); |
|
20 | -require_once (dirname(__FILE__) . '/init-config.php'); |
|
21 | -require_once (dirname(__FILE__) . '/settings/migrate-sigs-form.php'); |
|
22 | -require_once (dirname(__FILE__) . '/settings/migrate-sigs.php'); |
|
23 | -require_once (dirname(__FILE__) . '/settings/form.php'); |
|
24 | -require_once (dirname(__FILE__) . '/settings/save.php'); |
|
19 | +require_once (dirname(__FILE__).'/htmlpurifier/HTMLPurifier.auto.php'); |
|
20 | +require_once (dirname(__FILE__).'/init-config.php'); |
|
21 | +require_once (dirname(__FILE__).'/settings/migrate-sigs-form.php'); |
|
22 | +require_once (dirname(__FILE__).'/settings/migrate-sigs.php'); |
|
23 | +require_once (dirname(__FILE__).'/settings/form.php'); |
|
24 | +require_once (dirname(__FILE__).'/settings/save.php'); |
|
25 | 25 | |
26 | 26 | // define friendly configuration directives. you can expand this array |
27 | 27 | // to get more web-definable directives |
28 | -$PHORUM['mod_htmlpurifier']['directives'] = array( |
|
28 | +$PHORUM[ 'mod_htmlpurifier' ][ 'directives' ] = array( |
|
29 | 29 | 'URI.Host', // auto-detectable |
30 | 30 | 'URI.DisableExternal', |
31 | 31 | 'URI.DisableExternalResources', |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | ); |
44 | 44 | |
45 | 45 | // lower this setting if you're getting time outs/out of memory |
46 | -$PHORUM['mod_htmlpurifier']['migrate-sigs-increment'] = 100; |
|
46 | +$PHORUM[ 'mod_htmlpurifier' ][ 'migrate-sigs-increment' ] = 100; |
|
47 | 47 | |
48 | -if (isset($_POST['reset'])) { |
|
49 | - unset($PHORUM['mod_htmlpurifier']['config']); |
|
48 | +if (isset($_POST[ 'reset' ])) { |
|
49 | + unset($PHORUM[ 'mod_htmlpurifier' ][ 'config' ]); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($offset = phorum_htmlpurifier_migrate_sigs_check()) { |
53 | 53 | // migrate signatures |
54 | 54 | phorum_htmlpurifier_migrate_sigs($offset); |
55 | -} elseif(!empty($_POST)){ |
|
55 | +} elseif (!empty($_POST)) { |
|
56 | 56 | // save settings |
57 | 57 | phorum_htmlpurifier_save_settings(); |
58 | 58 | } |
@@ -9,7 +9,9 @@ |
||
9 | 9 | * by creating a 'config.php' file. |
10 | 10 | */ |
11 | 11 | |
12 | -if(!defined("PHORUM_ADMIN")) exit; |
|
12 | +if(!defined("PHORUM_ADMIN")) { |
|
13 | + exit; |
|
14 | +} |
|
13 | 15 | |
14 | 16 | // error reporting is good! |
15 | 17 | error_reporting(E_ALL ^ E_NOTICE); |
@@ -4,7 +4,7 @@ |
||
4 | 4 | * This is a stub include that automatically configures the include path. |
5 | 5 | */ |
6 | 6 | |
7 | -set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() ); |
|
7 | +set_include_path(dirname(__FILE__).PATH_SEPARATOR.get_include_path()); |
|
8 | 8 | require_once 'HTMLPurifier/Bootstrap.php'; |
9 | 9 | require_once 'HTMLPurifier.autoload.php'; |
10 | 10 |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * Emulation layer for code that used kses(), substituting in HTML Purifier. |
6 | 6 | */ |
7 | 7 | |
8 | -require_once dirname(__FILE__) . '/HTMLPurifier.auto.php'; |
|
8 | +require_once dirname(__FILE__).'/HTMLPurifier.auto.php'; |
|
9 | 9 | |
10 | 10 | function kses($string, $allowed_html, $allowed_protocols = null) |
11 | 11 | { |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | $allowed_elements = array(); |
14 | 14 | $allowed_attributes = array(); |
15 | 15 | foreach ($allowed_html as $element => $attributes) { |
16 | - $allowed_elements[$element] = true; |
|
16 | + $allowed_elements[ $element ] = true; |
|
17 | 17 | foreach ($attributes as $attribute => $x) { |
18 | - $allowed_attributes["$element.$attribute"] = true; |
|
18 | + $allowed_attributes[ "$element.$attribute" ] = true; |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | $config->set('HTML.AllowedElements', $allowed_elements); |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | public function addFilter($filter) |
126 | 126 | { |
127 | 127 | trigger_error( |
128 | - 'HTMLPurifier->addFilter() is deprecated, use configuration directives' . |
|
128 | + 'HTMLPurifier->addFilter() is deprecated, use configuration directives'. |
|
129 | 129 | ' in the Filter namespace or Filter.Custom', |
130 | 130 | E_USER_WARNING |
131 | 131 | ); |
132 | - $this->filters[] = $filter; |
|
132 | + $this->filters[ ] = $filter; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | |
179 | 179 | // setup filters |
180 | 180 | $filter_flags = $config->getBatch('Filter'); |
181 | - $custom_filters = $filter_flags['Custom']; |
|
182 | - unset($filter_flags['Custom']); |
|
181 | + $custom_filters = $filter_flags[ 'Custom' ]; |
|
182 | + unset($filter_flags[ 'Custom' ]); |
|
183 | 183 | $filters = array(); |
184 | 184 | foreach ($filter_flags as $filter => $flag) { |
185 | 185 | if (!$flag) { |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | continue; |
190 | 190 | } |
191 | 191 | $class = "HTMLPurifier_Filter_$filter"; |
192 | - $filters[] = new $class; |
|
192 | + $filters[ ] = new $class; |
|
193 | 193 | } |
194 | 194 | foreach ($custom_filters as $filter) { |
195 | 195 | // maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat |
196 | - $filters[] = $filter; |
|
196 | + $filters[ ] = $filter; |
|
197 | 197 | } |
198 | 198 | $filters = array_merge($filters, $this->filters); |
199 | 199 | // maybe prepare(), but later |
200 | 200 | |
201 | 201 | for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) { |
202 | - $html = $filters[$i]->preFilter($html, $config, $context); |
|
202 | + $html = $filters[ $i ]->preFilter($html, $config, $context); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | // purified HTML |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | ); |
221 | 221 | |
222 | 222 | for ($i = $filter_size - 1; $i >= 0; $i--) { |
223 | - $html = $filters[$i]->postFilter($html, $config, $context); |
|
223 | + $html = $filters[ $i ]->postFilter($html, $config, $context); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | $html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context); |
227 | - $this->context =& $context; |
|
227 | + $this->context = & $context; |
|
228 | 228 | return $html; |
229 | 229 | } |
230 | 230 | |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | { |
242 | 242 | $context_array = array(); |
243 | 243 | foreach ($array_of_html as $key => $html) { |
244 | - $array_of_html[$key] = $this->purify($html, $config); |
|
245 | - $context_array[$key] = $this->context; |
|
244 | + $array_of_html[ $key ] = $this->purify($html, $config); |
|
245 | + $context_array[ $key ] = $this->context; |
|
246 | 246 | } |
247 | 247 | $this->context = $context_array; |
248 | 248 | return $array_of_html; |