Passed
Push — develop ( e398eb...94c1bc )
by Neill
24:20
created
neon/core/helpers/Html.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -154,8 +154,9 @@  discard block
 block discarded – undo
154 154
 			self::processTags($allowableTags, $tagsProcessed);
155 155
 		}
156 156
 		if (is_array($value)) {
157
-			foreach ($value as $k => $v)
158
-				$value[$k] = static::sanitise($v, $allowableTags);
157
+			foreach ($value as $k => $v) {
158
+							$value[$k] = static::sanitise($v, $allowableTags);
159
+			}
159 160
 		} else {
160 161
 			if (!is_null($value)) {
161 162
 				if (isset($tagsProcessed[$allowableTags])) {
@@ -189,14 +190,16 @@  discard block
 block discarded – undo
189 190
 	{
190 191
 		profile_begin('Html::purify', 'html');
191 192
 		if (is_array($value)) {
192
-			foreach ($value as $k => $v)
193
-				$value[$k] = static::purify($v, $allowedTags);
193
+			foreach ($value as $k => $v) {
194
+							$value[$k] = static::purify($v, $allowedTags);
195
+			}
194 196
 		} else {
195 197
 			if (!is_null($value)) {
196
-				if ($allowedTags === false)
197
-					$value = trim(HtmlPurifier::process($value));
198
-				else
199
-					$value = trim(HtmlPurifier::process(strip_tags($value, $allowedTags)));
198
+				if ($allowedTags === false) {
199
+									$value = trim(HtmlPurifier::process($value));
200
+				} else {
201
+									$value = trim(HtmlPurifier::process(strip_tags($value, $allowedTags)));
202
+				}
200 203
 			}
201 204
 		}
202 205
 		profile_end('Html::purify', 'html');
@@ -214,8 +217,9 @@  discard block
 block discarded – undo
214 217
 	public static function encodeEntities($value, $entities = ENT_QUOTES)
215 218
 	{
216 219
 		if (is_array($value)) {
217
-			foreach ($value as $k => $v)
218
-				$value[$k] = static::encodeEntities($v, $entities);
220
+			foreach ($value as $k => $v) {
221
+							$value[$k] = static::encodeEntities($v, $entities);
222
+			}
219 223
 		} else {
220 224
 			$value = htmlentities($value, $entities);
221 225
 		}
@@ -251,18 +255,22 @@  discard block
 block discarded – undo
251 255
 	 */
252 256
 	public static function highlight($search, $html, $empty='')
253 257
 	{
254
-		if ($html === null)
255
-			return neon()->formatter->nullDisplay;
256
-		if ($html === '')
257
-			return $empty;
258
-		if (empty($search))
259
-			return $html;
258
+		if ($html === null) {
259
+					return neon()->formatter->nullDisplay;
260
+		}
261
+		if ($html === '') {
262
+					return $empty;
263
+		}
264
+		if (empty($search)) {
265
+					return $html;
266
+		}
260 267
 
261 268
 		profile_begin('Html::Highlight');
262 269
 		// escape search and html entities as otherwise the loadHTML or appendXML
263 270
 		// can blow up if there are < & > in the data
264
-		if (!is_array($search))
265
-			$search = [$search];
271
+		if (!is_array($search)) {
272
+					$search = [$search];
273
+		}
266 274
 		try {
267 275
 			foreach ($search as $s) {
268 276
 				// now search and rebuild the data
Please login to merge, or discard this patch.