@@ -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']); |
@@ -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); |
@@ -42,7 +42,10 @@ discard block |
||
42 | 42 | public function addFilter($filter, $config) |
43 | 43 | { |
44 | 44 | $r = $filter->prepare($config); |
45 | - if ($r === false) return; // null is ok, for backwards compat |
|
45 | + if ($r === false) { |
|
46 | + return; |
|
47 | + } |
|
48 | + // null is ok, for backwards compat |
|
46 | 49 | if ($filter->post) { |
47 | 50 | $this->postFilters[$filter->name] = $filter; |
48 | 51 | } else { |
@@ -79,9 +82,13 @@ discard block |
||
79 | 82 | $parser = new HTMLPurifier_URIParser(); |
80 | 83 | $this->base = $parser->parse($base_uri); |
81 | 84 | $this->defaultScheme = $this->base->scheme; |
82 | - if (is_null($this->host)) $this->host = $this->base->host; |
|
85 | + if (is_null($this->host)) { |
|
86 | + $this->host = $this->base->host; |
|
87 | + } |
|
83 | 88 | } |
84 | - if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); |
|
89 | + if (is_null($this->defaultScheme)) { |
|
90 | + $this->defaultScheme = $config->get('URI.DefaultScheme'); |
|
91 | + } |
|
85 | 92 | } |
86 | 93 | |
87 | 94 | public function getDefaultScheme($config, $context) |
@@ -93,7 +100,9 @@ discard block |
||
93 | 100 | { |
94 | 101 | foreach ($this->filters as $name => $f) { |
95 | 102 | $result = $f->filter($uri, $config, $context); |
96 | - if (!$result) return false; |
|
103 | + if (!$result) { |
|
104 | + return false; |
|
105 | + } |
|
97 | 106 | } |
98 | 107 | return true; |
99 | 108 | } |
@@ -102,7 +111,9 @@ discard block |
||
102 | 111 | { |
103 | 112 | foreach ($this->postFilters as $name => $f) { |
104 | 113 | $result = $f->filter($uri, $config, $context); |
105 | - if (!$result) return false; |
|
114 | + if (!$result) { |
|
115 | + return false; |
|
116 | + } |
|
106 | 117 | } |
107 | 118 | return true; |
108 | 119 | } |
@@ -133,7 +133,9 @@ |
||
133 | 133 | } |
134 | 134 | if (is_string($config)) { |
135 | 135 | $ret->loadIni($config); |
136 | - } elseif (is_array($config)) $ret->loadArray($config); |
|
136 | + } elseif (is_array($config)) { |
|
137 | + $ret->loadArray($config); |
|
138 | + } |
|
137 | 139 | return $ret; |
138 | 140 | } |
139 | 141 |
@@ -46,7 +46,9 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function toArray($t = NULL) { |
48 | 48 | $a = $this->front; |
49 | - if ($t !== NULL) $a[] = $t; |
|
49 | + if ($t !== NULL) { |
|
50 | + $a[] = $t; |
|
51 | + } |
|
50 | 52 | for ($i = count($this->back)-1; $i >= 0; $i--) { |
51 | 53 | $a[] = $this->back[$i]; |
52 | 54 | } |
@@ -59,7 +61,9 @@ discard block |
||
59 | 61 | * @return Original contents of new hole. |
60 | 62 | */ |
61 | 63 | public function next($t) { |
62 | - if ($t !== NULL) array_push($this->front, $t); |
|
64 | + if ($t !== NULL) { |
|
65 | + array_push($this->front, $t); |
|
66 | + } |
|
63 | 67 | return empty($this->back) ? NULL : array_pop($this->back); |
64 | 68 | } |
65 | 69 | |
@@ -82,7 +86,9 @@ discard block |
||
82 | 86 | * @return Original contents of new hole. |
83 | 87 | */ |
84 | 88 | public function prev($t) { |
85 | - if ($t !== NULL) array_push($this->back, $t); |
|
89 | + if ($t !== NULL) { |
|
90 | + array_push($this->back, $t); |
|
91 | + } |
|
86 | 92 | return empty($this->front) ? NULL : array_pop($this->front); |
87 | 93 | } |
88 | 94 | |
@@ -108,7 +114,9 @@ discard block |
||
108 | 114 | * @param Element to insert |
109 | 115 | */ |
110 | 116 | public function insertBefore($t) { |
111 | - if ($t !== NULL) array_push($this->front, $t); |
|
117 | + if ($t !== NULL) { |
|
118 | + array_push($this->front, $t); |
|
119 | + } |
|
112 | 120 | } |
113 | 121 | |
114 | 122 | /** |
@@ -116,7 +124,9 @@ discard block |
||
116 | 124 | * @param Element to insert |
117 | 125 | */ |
118 | 126 | public function insertAfter($t) { |
119 | - if ($t !== NULL) array_push($this->back, $t); |
|
127 | + if ($t !== NULL) { |
|
128 | + array_push($this->back, $t); |
|
129 | + } |
|
120 | 130 | } |
121 | 131 | |
122 | 132 | /** |
@@ -128,19 +128,25 @@ discard block |
||
128 | 128 | break; |
129 | 129 | } |
130 | 130 | }; |
131 | - if ($go) continue; |
|
131 | + if ($go) { |
|
132 | + continue; |
|
133 | + } |
|
132 | 134 | list($token, $d) = $node->toTokenPair(); |
133 | 135 | // base case |
134 | 136 | if ($excludes_enabled && isset($excludes[$node->name])) { |
135 | 137 | $node->dead = true; |
136 | - if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); |
|
138 | + if ($e) { |
|
139 | + $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); |
|
140 | + } |
|
137 | 141 | } else { |
138 | 142 | // XXX I suppose it would be slightly more efficient to |
139 | 143 | // avoid the allocation here and have children |
140 | 144 | // strategies handle it |
141 | 145 | $children = array(); |
142 | 146 | foreach ($node->children as $child) { |
143 | - if (!$child->dead) $children[] = $child; |
|
147 | + if (!$child->dead) { |
|
148 | + $children[] = $child; |
|
149 | + } |
|
144 | 150 | } |
145 | 151 | $result = $def->child->validateChildren($children, $config, $context); |
146 | 152 | if ($result === true) { |
@@ -148,7 +154,9 @@ discard block |
||
148 | 154 | $node->children = $children; |
149 | 155 | } elseif ($result === false) { |
150 | 156 | $node->dead = true; |
151 | - if ($e) $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); |
|
157 | + if ($e) { |
|
158 | + $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); |
|
159 | + } |
|
152 | 160 | } else { |
153 | 161 | $node->children = $result; |
154 | 162 | if ($e) { |
@@ -162,7 +162,9 @@ |
||
162 | 162 | $rewind_offset = $this->injectors[$i]->getRewindOffset(); |
163 | 163 | if (is_int($rewind_offset)) { |
164 | 164 | for ($j = 0; $j < $rewind_offset; $j++) { |
165 | - if (empty($zipper->front)) break; |
|
165 | + if (empty($zipper->front)) { |
|
166 | + break; |
|
167 | + } |
|
166 | 168 | $token = $zipper->prev($token); |
167 | 169 | // indicate that other injectors should not process this token, |
168 | 170 | // but we need to reprocess it |
@@ -41,7 +41,10 @@ |
||
41 | 41 | $matches = array(); |
42 | 42 | $result = preg_match($r_URI, $uri, $matches); |
43 | 43 | |
44 | - if (!$result) return false; // *really* invalid URI |
|
44 | + if (!$result) { |
|
45 | + return false; |
|
46 | + } |
|
47 | + // *really* invalid URI |
|
45 | 48 | |
46 | 49 | // seperate out parts |
47 | 50 | $scheme = !empty($matches[1]) ? $matches[2] : null; |
@@ -81,9 +81,13 @@ |
||
81 | 81 | if (isset($this->exclude[$token->name])) { |
82 | 82 | $r = true; |
83 | 83 | foreach ($this->exclude[$token->name] as $elem) { |
84 | - if (!isset($token->attr[$elem])) $r = false; |
|
84 | + if (!isset($token->attr[$elem])) { |
|
85 | + $r = false; |
|
86 | + } |
|
85 | 87 | } |
86 | - if ($r) return; |
|
88 | + if ($r) { |
|
89 | + return; |
|
90 | + } |
|
87 | 91 | } |
88 | 92 | if (isset($token->attr['id']) || isset($token->attr['name'])) { |
89 | 93 | return; |