@@ -50,7 +50,7 @@ |
||
50 | 50 | return $this->map->relationModel->row = $this->map->relationModel->result->first(); |
51 | 51 | } |
52 | 52 | } |
53 | - } elseif ( ! empty($this->map->relationTable)) { |
|
53 | + } elseif (!empty($this->map->relationTable)) { |
|
54 | 54 | $result = $this->map->referenceModel->qb |
55 | 55 | ->from($this->map->relationTable) |
56 | 56 | ->getWhere($conditions, 1); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | return $this->map->referenceModel->row = $this->map->referenceModel->result->first(); |
51 | 51 | } |
52 | 52 | } |
53 | - } elseif ( ! empty($this->map->referenceTable)) { |
|
53 | + } elseif (!empty($this->map->referenceTable)) { |
|
54 | 54 | $result = $this->map->relationModel->qb |
55 | 55 | ->from($this->map->referenceTable) |
56 | 56 | ->getWhere($conditions, 1); |
@@ -85,57 +85,57 @@ |
||
85 | 85 | |
86 | 86 | $timestamp = $this->unixTimestamp === true ? strtotime(date('Y-m-d H:i:s')) : date('Y-m-d H:i:s'); |
87 | 87 | |
88 | - if ( ! isset($sets[ 'record_status' ])) { |
|
89 | - $sets[ 'record_status' ] = $this->recordStatus; |
|
88 | + if (!isset($sets['record_status'])) { |
|
89 | + $sets['record_status'] = $this->recordStatus; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | if (empty($this->primary_keys)) { |
93 | 93 | $primary_key = isset($this->primary_key) ? $this->primary_key : 'id'; |
94 | 94 | |
95 | - if (empty($sets[ $primary_key ])) { |
|
96 | - if ( ! isset($sets[ 'record_create_user' ])) { |
|
97 | - $sets[ 'record_create_user' ] = $this->recordUser; |
|
95 | + if (empty($sets[$primary_key])) { |
|
96 | + if (!isset($sets['record_create_user'])) { |
|
97 | + $sets['record_create_user'] = $this->recordUser; |
|
98 | 98 | } |
99 | 99 | |
100 | - if ( ! isset($sets[ 'record_create_timestamp' ])) { |
|
101 | - $sets[ 'record_create_timestamp' ] = $timestamp; |
|
100 | + if (!isset($sets['record_create_timestamp'])) { |
|
101 | + $sets['record_create_timestamp'] = $timestamp; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | } else { |
105 | 105 | foreach ($this->primary_keys as $primary_key) { |
106 | - if (empty($sets[ $primary_key ])) { |
|
107 | - if ( ! isset($sets[ 'record_create_user' ])) { |
|
108 | - $sets[ 'record_create_user' ] = $this->recordUser; |
|
106 | + if (empty($sets[$primary_key])) { |
|
107 | + if (!isset($sets['record_create_user'])) { |
|
108 | + $sets['record_create_user'] = $this->recordUser; |
|
109 | 109 | } |
110 | 110 | |
111 | - if ( ! isset($sets[ 'record_create_timestamp' ])) { |
|
112 | - $sets[ 'record_create_timestamp' ] = $timestamp; |
|
111 | + if (!isset($sets['record_create_timestamp'])) { |
|
112 | + $sets['record_create_timestamp'] = $timestamp; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - $sets[ 'record_update_user' ] = $this->recordUser; |
|
118 | + $sets['record_update_user'] = $this->recordUser; |
|
119 | 119 | |
120 | - if ( ! isset($sets[ 'record_update_timestamp' ])) { |
|
121 | - $sets[ 'record_update_timestamp' ] = $timestamp; |
|
120 | + if (!isset($sets['record_update_timestamp'])) { |
|
121 | + $sets['record_update_timestamp'] = $timestamp; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
125 | 125 | protected function updateRecordSets(array &$sets) |
126 | 126 | { |
127 | - $sets[ 'record_status' ] = $this->recordStatus; |
|
128 | - $sets[ 'record_update_user' ] = $this->recordUser; |
|
127 | + $sets['record_status'] = $this->recordStatus; |
|
128 | + $sets['record_update_user'] = $this->recordUser; |
|
129 | 129 | |
130 | 130 | $timestamp = $this->unixTimestamp === true ? strtotime(date('Y-m-d H:i:s')) : date('Y-m-d H:i:s'); |
131 | 131 | |
132 | - if ( ! isset($sets[ 'record_update_timestamp' ])) { |
|
133 | - $sets[ 'record_update_timestamp' ] = $timestamp; |
|
132 | + if (!isset($sets['record_update_timestamp'])) { |
|
133 | + $sets['record_update_timestamp'] = $timestamp; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | if ($this->recordStatus === 'PUBLISH') { |
137 | - $sets[ 'record_delete_timestamp' ] = null; |
|
138 | - $sets[ 'record_delete_user' ] = null; |
|
137 | + $sets['record_delete_timestamp'] = null; |
|
138 | + $sets['record_delete_user'] = null; |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if (method_exists($this, 'getRecordOrdering')) { |
52 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
53 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($table); |
|
52 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
53 | + $sets['record_ordering'] = $this->getRecordOrdering($table); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | |
88 | 88 | if (empty($where)) { |
89 | 89 | if (empty($this->primaryKeys)) { |
90 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
90 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
91 | 91 | } else { |
92 | 92 | foreach ($this->primaryKeys as $primaryKey) { |
93 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
93 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | if (method_exists($this, 'getRecordOrdering')) { |
111 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
112 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($table); |
|
111 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
112 | + $sets['record_ordering'] = $this->getRecordOrdering($table); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | foreach ($sets as $set) { |
134 | 134 | $this->insertRecordSets($set); |
135 | 135 | |
136 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
137 | - $set[ 'record_ordering' ] = $this->getRecordOrdering($table); |
|
136 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
137 | + $set['record_ordering'] = $this->getRecordOrdering($table); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -163,11 +163,11 @@ discard block |
||
163 | 163 | |
164 | 164 | $where = []; |
165 | 165 | if (empty($this->primaryKeys)) { |
166 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
167 | - $this->qb->where($primaryKey, $sets[ $primaryKey ]); |
|
166 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
167 | + $this->qb->where($primaryKey, $sets[$primaryKey]); |
|
168 | 168 | } else { |
169 | 169 | foreach ($this->primaryKeys as $primaryKey) { |
170 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
170 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | foreach ($sets as $set) { |
180 | 180 | $this->updateRecordSets($set); |
181 | 181 | |
182 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
183 | - $set[ 'record_ordering' ] = $this->getRecordOrdering($table); |
|
182 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
183 | + $set['record_ordering'] = $this->getRecordOrdering($table); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |
@@ -219,19 +219,19 @@ discard block |
||
219 | 219 | $where = []; |
220 | 220 | |
221 | 221 | if (empty($this->primaryKeys)) { |
222 | - $where[ $primaryKey ] = $id; |
|
223 | - $sets[ $primaryKey ] = $id; |
|
222 | + $where[$primaryKey] = $id; |
|
223 | + $sets[$primaryKey] = $id; |
|
224 | 224 | } elseif (is_array($id)) { |
225 | 225 | foreach ($this->primaryKeys as $primaryKey) { |
226 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
227 | - $sets[ $primaryKey ] = $id[ $primaryKey ]; |
|
226 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
227 | + $sets[$primaryKey] = $id[$primaryKey]; |
|
228 | 228 | } |
229 | 229 | } else { |
230 | 230 | foreach ($this->primaryKeys as $primaryKey) { |
231 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
231 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
232 | 232 | } |
233 | 233 | |
234 | - $sets[ reset($this->primaryKeys) ] = $id; |
|
234 | + $sets[reset($this->primaryKeys)] = $id; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | // Reset Primary Keys |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $affectedRows = []; |
282 | 282 | |
283 | 283 | foreach ($ids as $id) { |
284 | - $affectedRows[ $id ] = $this->trash($id); |
|
284 | + $affectedRows[$id] = $this->trash($id); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | return $affectedRows; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $affectedRows = []; |
295 | 295 | |
296 | 296 | foreach ($ids as $id) { |
297 | - $affectedRows[ $id ] = $this->trashBy($id, $where, $table); |
|
297 | + $affectedRows[$id] = $this->trashBy($id, $where, $table); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | return $affectedRows; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | public function delete($id, $force = false, $table = null) |
306 | 306 | { |
307 | - if ((isset($table) AND is_bool($table)) OR ! isset($table)) { |
|
307 | + if ((isset($table) AND is_bool($table)) OR !isset($table)) { |
|
308 | 308 | $table = $this->table; |
309 | 309 | } |
310 | 310 | |
@@ -312,13 +312,13 @@ discard block |
||
312 | 312 | |
313 | 313 | $where = []; |
314 | 314 | if (empty($this->primaryKeys)) { |
315 | - $where[ $primaryKey ] = $id; |
|
315 | + $where[$primaryKey] = $id; |
|
316 | 316 | } elseif (is_array($id)) { |
317 | 317 | foreach ($this->primaryKeys as $primaryKey) { |
318 | - $where[ $primaryKey ] = $id[ $primaryKey ]; |
|
318 | + $where[$primaryKey] = $id[$primaryKey]; |
|
319 | 319 | } |
320 | 320 | } else { |
321 | - $where[ reset($this->primaryKeys) ] = $id; |
|
321 | + $where[reset($this->primaryKeys)] = $id; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | // Reset Primary Keys |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $affectedRows = []; |
357 | 357 | |
358 | 358 | foreach ($ids as $id) { |
359 | - $affectedRows[ $id ] = $this->delete($id, $force, $table); |
|
359 | + $affectedRows[$id] = $this->delete($id, $force, $table); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | return $affectedRows; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | $affectedRows = []; |
368 | 368 | |
369 | 369 | foreach ($ids as $id) { |
370 | - $affectedRows[ $id ] = $this->deleteBy($id, $where, $force, $table); |
|
370 | + $affectedRows[$id] = $this->deleteBy($id, $where, $force, $table); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | return $affectedRows; |
@@ -384,19 +384,19 @@ discard block |
||
384 | 384 | $where = []; |
385 | 385 | |
386 | 386 | if (empty($this->primaryKeys)) { |
387 | - $where[ $primaryKey ] = $id; |
|
388 | - $sets[ $primaryKey ] = $id; |
|
387 | + $where[$primaryKey] = $id; |
|
388 | + $sets[$primaryKey] = $id; |
|
389 | 389 | } elseif (is_array($id)) { |
390 | 390 | foreach ($this->primaryKeys as $primaryKey) { |
391 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
392 | - $sets[ $primaryKey ] = $id[ $primaryKey ]; |
|
391 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
392 | + $sets[$primaryKey] = $id[$primaryKey]; |
|
393 | 393 | } |
394 | 394 | } else { |
395 | 395 | foreach ($this->primaryKeys as $primaryKey) { |
396 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
396 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
397 | 397 | } |
398 | 398 | |
399 | - $sets[ reset($this->primaryKeys) ] = $id; |
|
399 | + $sets[reset($this->primaryKeys)] = $id; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | // Reset Primary Keys |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $affectedRows = []; |
440 | 440 | |
441 | 441 | foreach ($ids as $id) { |
442 | - $affectedRows[ $id ] = $this->publish($id, $table); |
|
442 | + $affectedRows[$id] = $this->publish($id, $table); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | return $affectedRows; |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $affectedRows = []; |
453 | 453 | |
454 | 454 | foreach ($ids as $id) { |
455 | - $affectedRows[ $id ] = $this->publishBy($id, $where, $table); |
|
455 | + $affectedRows[$id] = $this->publishBy($id, $where, $table); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | return $affectedRows; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ]); |
71 | 71 | } |
72 | 72 | |
73 | - $update[ 'id' ] = $row->id; |
|
73 | + $update['id'] = $row->id; |
|
74 | 74 | |
75 | 75 | if ($this->hasChild($row->id)) { |
76 | 76 | $right = $this->rebuild($row->id, $right, $depth + 1); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ->update($update = [ |
81 | 81 | 'record_right' => $right, |
82 | 82 | ]); |
83 | - $update[ 'id' ] = $row->id; |
|
83 | + $update['id'] = $row->id; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $i++; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ->get(); |
110 | 110 | |
111 | 111 | if ($result) { |
112 | - return (bool)($result->count() == 0 ? false : true); |
|
112 | + return (bool) ($result->count() == 0 ? false : true); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return false; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | ->get(); |
162 | 162 | |
163 | 163 | if ($result) { |
164 | - return (bool)($result->count() == 0 ? false : true); |
|
164 | + return (bool) ($result->count() == 0 ? false : true); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | return false; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $ormResult = new \SplFixedArray($result->count()); |
45 | 45 | |
46 | 46 | foreach ($result as $key => $row) { |
47 | - $ormResult[ $key ] = new Result\Row($row, $model); |
|
47 | + $ormResult[$key] = new Result\Row($row, $model); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | parent::__construct($ormResult->toArray()); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $this->model = new SplClassInfo($model); |
46 | 46 | |
47 | - if ( ! models()->has($this->model->getParameter())) { |
|
47 | + if (!models()->has($this->model->getParameter())) { |
|
48 | 48 | models()->register($this->model->getParameter(), $model); |
49 | 49 | } |
50 | 50 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @param $className |
17 | 17 | */ |
18 | 18 | spl_autoload_register( |
19 | - function ($className) { |
|
19 | + function($className) { |
|
20 | 20 | if (strpos($className, 'O2System\Reactor\\') === false) { |
21 | 21 | return; |
22 | 22 | } |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | if ($lastNsPos = strripos($className, '\\')) { |
28 | 28 | $namespace = substr($className, 0, $lastNsPos); |
29 | 29 | $className = substr($className, $lastNsPos + 1); |
30 | - $filePath = $namespace . '\\'; |
|
30 | + $filePath = $namespace.'\\'; |
|
31 | 31 | } |
32 | 32 | |
33 | - $filePath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
33 | + $filePath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
34 | 34 | |
35 | 35 | // Fixed Path |
36 | - $filePath = str_replace('O2System\Reactor\\', __DIR__ . DIRECTORY_SEPARATOR, $filePath); |
|
36 | + $filePath = str_replace('O2System\Reactor\\', __DIR__.DIRECTORY_SEPARATOR, $filePath); |
|
37 | 37 | $filePath = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $filePath); |
38 | 38 | |
39 | 39 | if (file_exists($filePath)) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | // ------------------------------------------------------------------------ |
18 | 18 | |
19 | -if ( ! function_exists('strip_image_tags')) { |
|
19 | +if (!function_exists('strip_image_tags')) { |
|
20 | 20 | /** |
21 | 21 | * strip_image_tags |
22 | 22 | * |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | //-------------------------------------------------------------------- |
43 | 43 | |
44 | -if ( ! function_exists('strip_cdata')) { |
|
44 | +if (!function_exists('strip_cdata')) { |
|
45 | 45 | /** |
46 | 46 | * strip_cdata |
47 | 47 | * |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | { |
56 | 56 | preg_match_all('/<!\[cdata\[(.*?)\]\]>/is', $source_code, $matches); |
57 | 57 | |
58 | - return str_replace($matches[ 0 ], $matches[ 1 ], $source_code); |
|
58 | + return str_replace($matches[0], $matches[1], $source_code); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | // ------------------------------------------------------------------------ |
62 | 62 | |
63 | -if ( ! function_exists('strips_all_tags')) { |
|
63 | +if (!function_exists('strips_all_tags')) { |
|
64 | 64 | /** |
65 | 65 | * strips_all_tags |
66 | 66 | * |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // ------------------------------------------------------------------------ |
86 | 86 | |
87 | -if ( ! function_exists('strips_tags')) { |
|
87 | +if (!function_exists('strips_tags')) { |
|
88 | 88 | /** |
89 | 89 | * strips_tags |
90 | 90 | * |
@@ -100,52 +100,52 @@ discard block |
||
100 | 100 | function strips_tags($source_code, $disallowed_tags = 'script|style|noframes|select|option', $allowed_tags = '') |
101 | 101 | { |
102 | 102 | //prep the string |
103 | - $source_code = ' ' . $source_code; |
|
103 | + $source_code = ' '.$source_code; |
|
104 | 104 | |
105 | 105 | //initialize keep tag logic |
106 | 106 | if (strlen($allowed_tags) > 0) { |
107 | 107 | $k = explode('|', $allowed_tags); |
108 | 108 | for ($i = 0; $i < count($k); $i++) { |
109 | - $source_code = str_replace('<' . $k[ $i ], '[{(' . $k[ $i ], $source_code); |
|
110 | - $source_code = str_replace('</' . $k[ $i ], '[{(/' . $k[ $i ], $source_code); |
|
109 | + $source_code = str_replace('<'.$k[$i], '[{('.$k[$i], $source_code); |
|
110 | + $source_code = str_replace('</'.$k[$i], '[{(/'.$k[$i], $source_code); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | //begin removal |
114 | 114 | //remove comment blocks |
115 | 115 | while (stripos($source_code, '<!--') > 0) { |
116 | - $pos[ 1 ] = stripos($source_code, '<!--'); |
|
117 | - $pos[ 2 ] = stripos($source_code, '-->', $pos[ 1 ]); |
|
118 | - $len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3; |
|
119 | - $x = substr($source_code, $pos[ 1 ], $len[ 1 ]); |
|
116 | + $pos[1] = stripos($source_code, '<!--'); |
|
117 | + $pos[2] = stripos($source_code, '-->', $pos[1]); |
|
118 | + $len[1] = $pos[2] - $pos[1] + 3; |
|
119 | + $x = substr($source_code, $pos[1], $len[1]); |
|
120 | 120 | $source_code = str_replace($x, '', $source_code); |
121 | 121 | } |
122 | 122 | //remove tags with content between them |
123 | 123 | if (strlen($disallowed_tags) > 0) { |
124 | 124 | $e = explode('|', $disallowed_tags); |
125 | 125 | for ($i = 0; $i < count($e); $i++) { |
126 | - while (stripos($source_code, '<' . $e[ $i ]) > 0) { |
|
127 | - $len[ 1 ] = strlen('<' . $e[ $i ]); |
|
128 | - $pos[ 1 ] = stripos($source_code, '<' . $e[ $i ]); |
|
129 | - $pos[ 2 ] = stripos($source_code, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ]); |
|
130 | - $len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ]; |
|
131 | - $x = substr($source_code, $pos[ 1 ], $len[ 2 ]); |
|
126 | + while (stripos($source_code, '<'.$e[$i]) > 0) { |
|
127 | + $len[1] = strlen('<'.$e[$i]); |
|
128 | + $pos[1] = stripos($source_code, '<'.$e[$i]); |
|
129 | + $pos[2] = stripos($source_code, $e[$i].'>', $pos[1] + $len[1]); |
|
130 | + $len[2] = $pos[2] - $pos[1] + $len[1]; |
|
131 | + $x = substr($source_code, $pos[1], $len[2]); |
|
132 | 132 | $source_code = str_replace($x, '', $source_code); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
136 | 136 | //remove remaining tags |
137 | 137 | while (stripos($source_code, '<') > 0) { |
138 | - $pos[ 1 ] = stripos($source_code, '<'); |
|
139 | - $pos[ 2 ] = stripos($source_code, '>', $pos[ 1 ]); |
|
140 | - $len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1; |
|
141 | - $x = substr($source_code, $pos[ 1 ], $len[ 1 ]); |
|
138 | + $pos[1] = stripos($source_code, '<'); |
|
139 | + $pos[2] = stripos($source_code, '>', $pos[1]); |
|
140 | + $len[1] = $pos[2] - $pos[1] + 1; |
|
141 | + $x = substr($source_code, $pos[1], $len[1]); |
|
142 | 142 | $source_code = str_replace($x, '', $source_code); |
143 | 143 | } |
144 | 144 | //finalize keep tag |
145 | 145 | if (strlen($allowed_tags) > 0) { |
146 | 146 | for ($i = 0; $i < count($k); $i++) { |
147 | - $source_code = str_replace('[{(' . $k[ $i ], '<' . $k[ $i ], $source_code); |
|
148 | - $source_code = str_replace('[{(/' . $k[ $i ], '</' . $k[ $i ], $source_code); |
|
147 | + $source_code = str_replace('[{('.$k[$i], '<'.$k[$i], $source_code); |
|
148 | + $source_code = str_replace('[{(/'.$k[$i], '</'.$k[$i], $source_code); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // ------------------------------------------------------------------------ |
157 | 157 | |
158 | -if ( ! function_exists('strip_word_doc')) { |
|
158 | +if (!function_exists('strip_word_doc')) { |
|
159 | 159 | /** |
160 | 160 | * strip_word_doc |
161 | 161 | * |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | //-------------------------------------------------------------------- |
254 | 254 | |
255 | -if ( ! function_exists('strip_slashes_recursive')) { |
|
255 | +if (!function_exists('strip_slashes_recursive')) { |
|
256 | 256 | /** |
257 | 257 | * strip_slashes_recursive |
258 | 258 | * |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | // ------------------------------------------------------------------------ |
285 | 285 | |
286 | -if ( ! function_exists('strip_comments')) { |
|
286 | +if (!function_exists('strip_comments')) { |
|
287 | 287 | /** |
288 | 288 | * strip_comments |
289 | 289 | * |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | // ------------------------------------------------------------------------ |
303 | 303 | |
304 | -if ( ! function_exists('clean_white_space')) { |
|
304 | +if (!function_exists('clean_white_space')) { |
|
305 | 305 | /** |
306 | 306 | * clean_white_space |
307 | 307 | * |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | |
322 | 322 | // ------------------------------------------------------------------------ |
323 | 323 | |
324 | -if ( ! function_exists('encode_php_tags')) { |
|
324 | +if (!function_exists('encode_php_tags')) { |
|
325 | 325 | /** |
326 | 326 | * encode_php_tags |
327 | 327 | * |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | // ------------------------------------------------------------------------ |
341 | 341 | |
342 | -if ( ! function_exists('escape_html')) { |
|
342 | +if (!function_exists('escape_html')) { |
|
343 | 343 | /** |
344 | 344 | * escape_html |
345 | 345 | * |