@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getSigning() |
| 36 | 36 | { |
| 37 | - return (string) $this->storage->fetch($this->name); |
|
| 37 | + return (string)$this->storage->fetch($this->name); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getVerifying() |
| 46 | 46 | { |
| 47 | - return (string) $this->storage->fetch($this->name); |
|
| 47 | + return (string)$this->storage->fetch($this->name); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | protected function fileName($name) |
| 59 | 59 | { |
| 60 | - return $this->storagePath . "/{$this->systemSecret}-key-{$name}.php"; |
|
| 60 | + return $this->storagePath."/{$this->systemSecret}-key-{$name}.php"; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | if (isset($this->tables[$table])) { |
| 182 | 182 | if (isset($this->tables[$table]['create']) && $this->tables[$table]['create']) { |
| 183 | 183 | $this->tables[$table]['keys'][$name]['columns'] = $columnList; |
| 184 | - $this->tables[$table]['keys'][$name]['unique'] = (bool) $unique; |
|
| 184 | + $this->tables[$table]['keys'][$name]['unique'] = (bool)$unique; |
|
| 185 | 185 | } else { |
| 186 | 186 | $add = ($unique ? 'ADD UNIQUE INDEX' : 'ADD INDEX'); |
| 187 | 187 | $this->queue[] = "ALTER TABLE `{$this->tables[$table]['name']}` {$add} `{$name}` ({$columnList})"; |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | return true; |
| 325 | 325 | } else { |
| 326 | - $this->queue[] = "ALTER TABLE `{$tableDef['name']}` " . |
|
| 326 | + $this->queue[] = "ALTER TABLE `{$tableDef['name']}` ". |
|
| 327 | 327 | "CHANGE COLUMN `{$column}` `{$newName}` {$attributes} "; |
| 328 | 328 | // loop thru and find the column |
| 329 | 329 | foreach ($tableDef['columns'] as &$col) { |
@@ -795,8 +795,8 @@ discard block |
||
| 795 | 795 | $sql = 'SELECT TABLE_NAME, ENGINE, CHARACTER_SET_NAME '; |
| 796 | 796 | $sql .= ' FROM `INFORMATION_SCHEMA`.`TABLES` t, '; |
| 797 | 797 | $sql .= ' `INFORMATION_SCHEMA`.`COLLATIONS` c '; |
| 798 | - $sql .= ' WHERE t.TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
| 799 | - $sql .= ' AND t.TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
| 798 | + $sql .= ' WHERE t.TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
| 799 | + $sql .= ' AND t.TABLE_NAME = \''.$this->name($table).'\' '; |
|
| 800 | 800 | $sql .= ' AND t.TABLE_COLLATION = c.COLLATION_NAME '; |
| 801 | 801 | |
| 802 | 802 | $result = $this->execSql($sql); |
@@ -808,21 +808,21 @@ discard block |
||
| 808 | 808 | return true; |
| 809 | 809 | } |
| 810 | 810 | $tableDef['name'] = $tableSchema['TABLE_NAME']; |
| 811 | - $tableDef['options'] = 'ENGINE=' . $tableSchema['ENGINE'] . ' ' |
|
| 812 | - . 'DEFAULT CHARSET=' . $tableSchema['CHARACTER_SET_NAME']; |
|
| 811 | + $tableDef['options'] = 'ENGINE='.$tableSchema['ENGINE'].' ' |
|
| 812 | + . 'DEFAULT CHARSET='.$tableSchema['CHARACTER_SET_NAME']; |
|
| 813 | 813 | |
| 814 | 814 | $sql = 'SELECT * '; |
| 815 | 815 | $sql .= ' FROM `INFORMATION_SCHEMA`.`COLUMNS` '; |
| 816 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
| 817 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
| 816 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
| 817 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
| 818 | 818 | $sql .= ' ORDER BY `ORDINAL_POSITION` '; |
| 819 | 819 | |
| 820 | 820 | $result = $this->execSql($sql); |
| 821 | 821 | |
| 822 | 822 | while ($column = $this->fetch($result)) { |
| 823 | - $attributes = ' ' . $column['COLUMN_TYPE'] . ' ' |
|
| 823 | + $attributes = ' '.$column['COLUMN_TYPE'].' ' |
|
| 824 | 824 | . (($column['IS_NULLABLE'] === 'NO') ? ' NOT NULL ' : '') |
| 825 | - . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '" . $column['COLUMN_DEFAULT'] . "' ") |
|
| 825 | + . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '".$column['COLUMN_DEFAULT']."' ") |
|
| 826 | 826 | . $column['EXTRA']; |
| 827 | 827 | |
| 828 | 828 | $columnDef = array( |
@@ -836,8 +836,8 @@ discard block |
||
| 836 | 836 | $sql = 'SELECT `INDEX_NAME`, `SEQ_IN_INDEX`, `NON_UNIQUE`, '; |
| 837 | 837 | $sql .= ' `COLUMN_NAME`, `SUB_PART` '; |
| 838 | 838 | $sql .= ' FROM `INFORMATION_SCHEMA`.`STATISTICS` '; |
| 839 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
| 840 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
| 839 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
| 840 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
| 841 | 841 | $sql .= ' ORDER BY `INDEX_NAME`, `SEQ_IN_INDEX` '; |
| 842 | 842 | |
| 843 | 843 | $result = $this->execSql($sql); |
@@ -854,13 +854,13 @@ discard block |
||
| 854 | 854 | $lastKey = $key['INDEX_NAME']; |
| 855 | 855 | $keyCols = $key['COLUMN_NAME']; |
| 856 | 856 | if (!empty($key['SUB_PART'])) { |
| 857 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
| 857 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
| 858 | 858 | } |
| 859 | 859 | $keyUnique = !$key['NON_UNIQUE']; |
| 860 | 860 | } else { |
| 861 | - $keyCols .= ', ' . $key['COLUMN_NAME']; |
|
| 861 | + $keyCols .= ', '.$key['COLUMN_NAME']; |
|
| 862 | 862 | if (!empty($key['SUB_PART'])) { |
| 863 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
| 863 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
| 864 | 864 | } |
| 865 | 865 | } |
| 866 | 866 | }; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $count = 0; |
| 48 | 48 | |
| 49 | 49 | foreach ($data as $row) { |
| 50 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
| 50 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
| 51 | 51 | $valueClause = ' VALUES ('; |
| 52 | 52 | $first = true; |
| 53 | 53 | foreach ($row as $column => $value) { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $valueClause .= $db->quote($value); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
| 65 | + $sql = $insertInto.') '.$valueClause.')'; |
|
| 66 | 66 | |
| 67 | 67 | $result = $db->queryF($sql); |
| 68 | 68 | if (false !== $result) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 107 | 107 | |
| 108 | 108 | $prefixedTable = $db->prefix($table); |
| 109 | - $sql = 'TRUNCATE TABLE ' . $prefixedTable; |
|
| 109 | + $sql = 'TRUNCATE TABLE '.$prefixedTable; |
|
| 110 | 110 | $result = $db->queryF($sql); |
| 111 | 111 | if (false !== $result) { |
| 112 | 112 | $result = $db->getAffectedRows(); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 129 | 129 | |
| 130 | 130 | $prefixedTable = $db->prefix($table); |
| 131 | - $sql = 'SELECT COUNT(*) as count FROM ' . $prefixedTable . ' '; |
|
| 131 | + $sql = 'SELECT COUNT(*) as count FROM '.$prefixedTable.' '; |
|
| 132 | 132 | if (isset($criteria) && is_subclass_of($criteria, '\CriteriaElement')) { |
| 133 | 133 | /* @var $criteria \CriteriaCompo */ |
| 134 | 134 | $sql .= $criteria->renderWhere(); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 156 | 156 | |
| 157 | 157 | $prefixedTable = $db->prefix($table); |
| 158 | - $sql = 'SELECT * FROM ' . $prefixedTable . ' '; |
|
| 158 | + $sql = 'SELECT * FROM '.$prefixedTable.' '; |
|
| 159 | 159 | if (isset($criteria) && is_subclass_of($criteria, '\CriteriaElement')) { |
| 160 | 160 | /* @var $criteria \CriteriaCompo */ |
| 161 | 161 | $sql .= $criteria->renderWhere(); |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | if (!isset($this->targetDefinitions)) { |
| 122 | 122 | $this->targetDefinitions = Yaml::read($this->tableDefinitionFile); |
| 123 | 123 | if (null === $this->targetDefinitions) { |
| 124 | - throw new \RuntimeException("No schema definition " . $this->tableDefinitionFile); |
|
| 124 | + throw new \RuntimeException("No schema definition ".$this->tableDefinitionFile); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | return $this->targetDefinitions; |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | class FilterInput |
| 36 | 36 | { |
| 37 | - protected $tagsArray; // default is empty array |
|
| 38 | - protected $attrArray; // default is empty array |
|
| 37 | + protected $tagsArray; // default is empty array |
|
| 38 | + protected $attrArray; // default is empty array |
|
| 39 | 39 | |
| 40 | - protected $tagsMethod; // default is 0 |
|
| 41 | - protected $attrMethod; // default is 0 |
|
| 40 | + protected $tagsMethod; // default is 0 |
|
| 41 | + protected $attrMethod; // default is 0 |
|
| 42 | 42 | |
| 43 | - protected $xssAuto; // default is 1 |
|
| 43 | + protected $xssAuto; // default is 1 |
|
| 44 | 44 | protected $tagBlacklist = array( |
| 45 | 45 | 'applet', |
| 46 | 46 | 'body', |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $attrArray[$i] = strtolower($attrArray[$i]); |
| 95 | 95 | } |
| 96 | 96 | // assign to member vars |
| 97 | - $this->tagsArray = (array) $tagsArray; |
|
| 98 | - $this->attrArray = (array) $attrArray; |
|
| 97 | + $this->tagsArray = (array)$tagsArray; |
|
| 98 | + $this->attrArray = (array)$attrArray; |
|
| 99 | 99 | $this->tagsMethod = $tagsMethod; |
| 100 | 100 | $this->attrMethod = $attrMethod; |
| 101 | 101 | $this->xssAuto = $xssAuto; |
@@ -213,61 +213,61 @@ discard block |
||
| 213 | 213 | case 'INT': |
| 214 | 214 | case 'INTEGER': |
| 215 | 215 | // Only use the first integer value |
| 216 | - preg_match('/-?\d+/', (string) $source, $matches); |
|
| 217 | - $result = @ (int) $matches[0]; |
|
| 216 | + preg_match('/-?\d+/', (string)$source, $matches); |
|
| 217 | + $result = @ (int)$matches[0]; |
|
| 218 | 218 | break; |
| 219 | 219 | |
| 220 | 220 | case 'FLOAT': |
| 221 | 221 | case 'DOUBLE': |
| 222 | 222 | // Only use the first floating point value |
| 223 | - preg_match('/-?\d+(\.\d+)?/', (string) $source, $matches); |
|
| 224 | - $result = @ (float) $matches[0]; |
|
| 223 | + preg_match('/-?\d+(\.\d+)?/', (string)$source, $matches); |
|
| 224 | + $result = @ (float)$matches[0]; |
|
| 225 | 225 | break; |
| 226 | 226 | |
| 227 | 227 | case 'BOOL': |
| 228 | 228 | case 'BOOLEAN': |
| 229 | - $result = (bool) $source; |
|
| 229 | + $result = (bool)$source; |
|
| 230 | 230 | break; |
| 231 | 231 | |
| 232 | 232 | case 'WORD': |
| 233 | - $result = (string) preg_replace('/[^A-Z_]/i', '', $source); |
|
| 233 | + $result = (string)preg_replace('/[^A-Z_]/i', '', $source); |
|
| 234 | 234 | break; |
| 235 | 235 | |
| 236 | 236 | case 'ALPHANUM': |
| 237 | 237 | case 'ALNUM': |
| 238 | - $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source); |
|
| 238 | + $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source); |
|
| 239 | 239 | break; |
| 240 | 240 | |
| 241 | 241 | case 'CMD': |
| 242 | - $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source); |
|
| 242 | + $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source); |
|
| 243 | 243 | $result = strtolower($result); |
| 244 | 244 | break; |
| 245 | 245 | |
| 246 | 246 | case 'BASE64': |
| 247 | - $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source); |
|
| 247 | + $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source); |
|
| 248 | 248 | break; |
| 249 | 249 | |
| 250 | 250 | case 'STRING': |
| 251 | - $result = (string) $this->process($source); |
|
| 251 | + $result = (string)$this->process($source); |
|
| 252 | 252 | break; |
| 253 | 253 | |
| 254 | 254 | case 'ARRAY': |
| 255 | - $result = (array) $this->process($source); |
|
| 255 | + $result = (array)$this->process($source); |
|
| 256 | 256 | break; |
| 257 | 257 | |
| 258 | 258 | case 'PATH': |
| 259 | - $source = trim((string) $source); |
|
| 259 | + $source = trim((string)$source); |
|
| 260 | 260 | $pattern = '/^([-_\.\/A-Z0-9=&%?~]+)(.*)$/i'; |
| 261 | 261 | preg_match($pattern, $source, $matches); |
| 262 | - $result = @ (string) $matches[1]; |
|
| 262 | + $result = @ (string)$matches[1]; |
|
| 263 | 263 | break; |
| 264 | 264 | |
| 265 | 265 | case 'USERNAME': |
| 266 | - $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); |
|
| 266 | + $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source); |
|
| 267 | 267 | break; |
| 268 | 268 | |
| 269 | 269 | case 'WEBURL': |
| 270 | - $result = (string) $this->process($source); |
|
| 270 | + $result = (string)$this->process($source); |
|
| 271 | 271 | // allow only relative, http or https |
| 272 | 272 | $urlparts = parse_url($result); |
| 273 | 273 | if (!empty($urlparts['scheme']) |
@@ -282,17 +282,17 @@ discard block |
||
| 282 | 282 | break; |
| 283 | 283 | |
| 284 | 284 | case 'EMAIL': |
| 285 | - $result = (string) $source; |
|
| 286 | - if (!filter_var((string) $source, FILTER_VALIDATE_EMAIL)) { |
|
| 285 | + $result = (string)$source; |
|
| 286 | + if (!filter_var((string)$source, FILTER_VALIDATE_EMAIL)) { |
|
| 287 | 287 | $result = ''; |
| 288 | 288 | } |
| 289 | 289 | break; |
| 290 | 290 | |
| 291 | 291 | case 'IP': |
| 292 | - $result = (string) $source; |
|
| 292 | + $result = (string)$source; |
|
| 293 | 293 | // this may be too restrictive. |
| 294 | 294 | // Should the FILTER_FLAG_NO_PRIV_RANGE flag be excluded? |
| 295 | - if (!filter_var((string) $source, FILTER_VALIDATE_IP)) { |
|
| 295 | + if (!filter_var((string)$source, FILTER_VALIDATE_IP)) { |
|
| 296 | 296 | $result = ''; |
| 297 | 297 | } |
| 298 | 298 | break; |
@@ -425,20 +425,20 @@ discard block |
||
| 425 | 425 | // reconstruct tag with allowed attributes |
| 426 | 426 | if (!$isCloseTag) { |
| 427 | 427 | $attrSet = $this->filterAttr($attrSet); |
| 428 | - $preTag .= '<' . $tagName; |
|
| 428 | + $preTag .= '<'.$tagName; |
|
| 429 | 429 | $attrSetCount = count($attrSet); |
| 430 | 430 | for ($i = 0; $i < $attrSetCount; ++$i) { |
| 431 | - $preTag .= ' ' . $attrSet[$i]; |
|
| 431 | + $preTag .= ' '.$attrSet[$i]; |
|
| 432 | 432 | } |
| 433 | 433 | // reformat single tags to XHTML |
| 434 | - if (strpos($fromTagOpen, "</" . $tagName)) { |
|
| 434 | + if (strpos($fromTagOpen, "</".$tagName)) { |
|
| 435 | 435 | $preTag .= '>'; |
| 436 | 436 | } else { |
| 437 | 437 | $preTag .= ' />'; |
| 438 | 438 | } |
| 439 | 439 | } else { |
| 440 | 440 | // just the tagname |
| 441 | - $preTag .= '</' . $tagName . '>'; |
|
| 441 | + $preTag .= '</'.$tagName.'>'; |
|
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | // find next tag's start |
@@ -515,13 +515,13 @@ discard block |
||
| 515 | 515 | if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { |
| 516 | 516 | if ($attrSubSet[1]) { |
| 517 | 517 | // attr has value |
| 518 | - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; |
|
| 518 | + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[1].'"'; |
|
| 519 | 519 | } elseif ($attrSubSet[1] == "0") { |
| 520 | 520 | // attr has decimal zero as value |
| 521 | - $newSet[] = $attrSubSet[0] . '="0"'; |
|
| 521 | + $newSet[] = $attrSubSet[0].'="0"'; |
|
| 522 | 522 | } else { |
| 523 | 523 | // reformat single attributes to XHTML |
| 524 | - $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"'; |
|
| 524 | + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[0].'"'; |
|
| 525 | 525 | } |
| 526 | 526 | } |
| 527 | 527 | } |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | // convert decimal |
| 545 | 545 | $source = preg_replace_callback( |
| 546 | 546 | '/&#(\d+);/m', |
| 547 | - function ($matches) { |
|
| 547 | + function($matches) { |
|
| 548 | 548 | return chr($matches[1]); |
| 549 | 549 | }, |
| 550 | 550 | $source |
@@ -552,8 +552,8 @@ discard block |
||
| 552 | 552 | // convert hex notation |
| 553 | 553 | $source = preg_replace_callback( |
| 554 | 554 | '/&#x([a-f0-9]+);/mi', |
| 555 | - function ($matches) { |
|
| 556 | - return chr('0x' . $matches[1]); |
|
| 555 | + function($matches) { |
|
| 556 | + return chr('0x'.$matches[1]); |
|
| 557 | 557 | }, |
| 558 | 558 | $source |
| 559 | 559 | ); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $tableau = array_filter($tableau, array(static::stopWordsObject(), 'check')); |
| 276 | 276 | $title = implode("-", $tableau); |
| 277 | 277 | |
| 278 | - $title = (empty($title)) ? '' : $title . $extension; |
|
| 278 | + $title = (empty($title)) ? '' : $title.$extension; |
|
| 279 | 279 | return $title; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $start = empty($pos) ? 0 : min($pos); |
| 303 | 303 | |
| 304 | - $start = max($start - (int) ($length / 2), 0); |
|
| 304 | + $start = max($start - (int)($length / 2), 0); |
|
| 305 | 305 | |
| 306 | 306 | $pre = ($start > 0); // need an ellipsis in front? |
| 307 | 307 | if (function_exists('mb_strlen')) { |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | - $haystack = ($pre ? static::ELLIPSIS : '') . trim($haystack) . ($post ? static::ELLIPSIS : ''); |
|
| 340 | + $haystack = ($pre ? static::ELLIPSIS : '').trim($haystack).($post ? static::ELLIPSIS : ''); |
|
| 341 | 341 | return $haystack; |
| 342 | 342 | } |
| 343 | 343 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | protected static function getNeedlePositions($haystack, $needles) |
| 375 | 375 | { |
| 376 | 376 | $pos = array(); |
| 377 | - $needles = empty($needles) ? array() : (array) $needles; |
|
| 377 | + $needles = empty($needles) ? array() : (array)$needles; |
|
| 378 | 378 | foreach ($needles as $needle) { |
| 379 | 379 | if (function_exists('mb_stripos')) { |
| 380 | 380 | $i = mb_stripos($haystack, $needle, 0, static::ENCODING); |
@@ -441,10 +441,10 @@ discard block |
||
| 441 | 441 | { |
| 442 | 442 | $search = array( |
| 443 | 443 | "'<script[^>]*?>.*?</script>'si", // Strip out javascript |
| 444 | - "'<img.*?/>'si", // Strip out img tags |
|
| 445 | - "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags |
|
| 446 | - "'([\r\n])[\s]+'", // Strip out white space |
|
| 447 | - "'&(quot|#34);'i", // Replace HTML entities |
|
| 444 | + "'<img.*?/>'si", // Strip out img tags |
|
| 445 | + "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags |
|
| 446 | + "'([\r\n])[\s]+'", // Strip out white space |
|
| 447 | + "'&(quot|#34);'i", // Replace HTML entities |
|
| 448 | 448 | "'&(amp|#38);'i", |
| 449 | 449 | "'&(lt|#60);'i", |
| 450 | 450 | "'&(gt|#62);'i", |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | |
| 476 | 476 | preg_replace_callback( |
| 477 | 477 | '/&#(\d+);/', |
| 478 | - function ($matches) { |
|
| 478 | + function($matches) { |
|
| 479 | 479 | return chr($matches[1]); |
| 480 | 480 | }, |
| 481 | 481 | $document |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | public static function getString($name, $default = '', $hash = 'default', $mask = 0) |
| 238 | 238 | { |
| 239 | 239 | // Cast to string, in case static::MASK_ALLOW_RAW was specified for mask |
| 240 | - return (string) static::getVar($name, $default, $hash, 'string', $mask); |
|
| 240 | + return (string)static::getVar($name, $default, $hash, 'string', $mask); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public static function getText($name, $default = '', $hash = 'default') |
| 267 | 267 | { |
| 268 | - return (string) static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
| 268 | + return (string)static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public static function getUrl($name, $default = '', $hash = 'default') |
| 281 | 281 | { |
| 282 | - return (string) static::getVar($name, $default, $hash, 'weburl'); |
|
| 282 | + return (string)static::getVar($name, $default, $hash, 'weburl'); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /** |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public static function getPath($name, $default = '', $hash = 'default') |
| 295 | 295 | { |
| 296 | - return (string) static::getVar($name, $default, $hash, 'path'); |
|
| 296 | + return (string)static::getVar($name, $default, $hash, 'path'); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public static function getEmail($name, $default = '', $hash = 'default') |
| 309 | 309 | { |
| 310 | - $ret = (string) static::getVar($name, $default, $hash, 'email'); |
|
| 310 | + $ret = (string)static::getVar($name, $default, $hash, 'email'); |
|
| 311 | 311 | return empty($ret) ? $default : $ret; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public static function getIP($name, $default = '', $hash = 'default') |
| 324 | 324 | { |
| 325 | - $ret = (string) static::getVar($name, $default, $hash, 'ip'); |
|
| 325 | + $ret = (string)static::getVar($name, $default, $hash, 'ip'); |
|
| 326 | 326 | return empty($ret) ? $default : $ret; |
| 327 | 327 | } |
| 328 | 328 | |
@@ -56,8 +56,8 @@ |
||
| 56 | 56 | $language = 'english'; |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | - $path = XOOPS_ROOT_PATH . '/' . ((empty($domain) || 'global' === $domain) ? '' |
|
| 60 | - : "modules/{$domain}/") . 'language'; |
|
| 59 | + $path = XOOPS_ROOT_PATH.'/'.((empty($domain) || 'global' === $domain) ? '' |
|
| 60 | + : "modules/{$domain}/").'language'; |
|
| 61 | 61 | if (!$ret = static::loadFile("{$path}/{$language}/{$name}.php")) { |
| 62 | 62 | $ret = static::loadFile("{$path}/english/{$name}.php"); |
| 63 | 63 | } |