@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | public static function integerish($value, $message = '') |
| 196 | 196 | { |
| 197 | - if (!is_numeric($value) || $value != (int) $value) { |
|
| 197 | + if (!is_numeric($value) || $value != (int)$value) { |
|
| 198 | 198 | static::reportInvalidArgument(sprintf( |
| 199 | 199 | $message ?: 'Expected an integerish value. Got: %s', |
| 200 | 200 | static::typeToString($value) |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | return '"'.$value.'"'; |
| 1056 | 1056 | } |
| 1057 | 1057 | |
| 1058 | - return (string) $value; |
|
| 1058 | + return (string)$value; |
|
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | 1061 | protected static function typeToString($value) |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $RandomCompatDIR = dirname(__FILE__); |
| 56 | 56 | |
| 57 | -require_once $RandomCompatDIR . '/byte_safe_strings.php'; |
|
| 58 | -require_once $RandomCompatDIR . '/cast_to_int.php'; |
|
| 59 | -require_once $RandomCompatDIR . '/error_polyfill.php'; |
|
| 57 | +require_once $RandomCompatDIR.'/byte_safe_strings.php'; |
|
| 58 | +require_once $RandomCompatDIR.'/cast_to_int.php'; |
|
| 59 | +require_once $RandomCompatDIR.'/error_polyfill.php'; |
|
| 60 | 60 | |
| 61 | 61 | if (!is_callable('random_bytes')) { |
| 62 | 62 | /** |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | if (extension_loaded('libsodium')) { |
| 77 | 77 | // See random_bytes_libsodium.php |
| 78 | 78 | if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) { |
| 79 | - require_once $RandomCompatDIR . '/random_bytes_libsodium.php'; |
|
| 79 | + require_once $RandomCompatDIR.'/random_bytes_libsodium.php'; |
|
| 80 | 80 | } elseif (method_exists('Sodium', 'randombytes_buf')) { |
| 81 | - require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php'; |
|
| 81 | + require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.php'; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // place, that is not helpful to us here. |
| 118 | 118 | |
| 119 | 119 | // See random_bytes_dev_urandom.php |
| 120 | - require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php'; |
|
| 120 | + require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php'; |
|
| 121 | 121 | } |
| 122 | 122 | // Unset variables after use |
| 123 | 123 | $RandomCompat_basedir = null; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | extension_loaded('mcrypt') |
| 160 | 160 | ) { |
| 161 | 161 | // See random_bytes_mcrypt.php |
| 162 | - require_once $RandomCompatDIR . '/random_bytes_mcrypt.php'; |
|
| 162 | + require_once $RandomCompatDIR.'/random_bytes_mcrypt.php'; |
|
| 163 | 163 | } |
| 164 | 164 | $RandomCompatUrandom = null; |
| 165 | 165 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); |
| 185 | 185 | if (method_exists($RandomCompatCOMtest, 'GetRandom')) { |
| 186 | 186 | // See random_bytes_com_dotnet.php |
| 187 | - require_once $RandomCompatDIR . '/random_bytes_com_dotnet.php'; |
|
| 187 | + require_once $RandomCompatDIR.'/random_bytes_com_dotnet.php'; |
|
| 188 | 188 | } |
| 189 | 189 | } catch (com_exception $e) { |
| 190 | 190 | // Don't try to use it. |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | if (!is_callable('random_int')) { |
| 222 | - require_once $RandomCompatDIR . '/random_int.php'; |
|
| 222 | + require_once $RandomCompatDIR.'/random_int.php'; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $RandomCompatDIR = null; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this->loadInfo($dirname, $verbose); |
| 76 | 76 | } |
| 77 | 77 | $this->setVar('name', $this->modinfo['name'], true); |
| 78 | - $this->setVar('version', (int)(100 * ((float) $this->modinfo['version'] + 0.001)), true); |
|
| 78 | + $this->setVar('version', (int)(100 * ((float)$this->modinfo['version'] + 0.001)), true); |
|
| 79 | 79 | $this->setVar('dirname', $this->modinfo['dirname'], true); |
| 80 | 80 | $hasmain = (isset($this->modinfo['hasMain']) && $this->modinfo['hasMain'] == 1) ? 1 : 0; |
| 81 | 81 | $hasadmin = (isset($this->modinfo['hasAdmin']) && $this->modinfo['hasAdmin'] == 1) ? 1 : 0; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function mainLink() |
| 166 | 166 | { |
| 167 | 167 | if ($this->getVar('hasmain') == 1) { |
| 168 | - $ret = '<a href="' . XOOPS_URL . '/modules/' . $this->getVar('dirname') . '/">' . $this->getVar('name') . '</a>'; |
|
| 168 | + $ret = '<a href="'.XOOPS_URL.'/modules/'.$this->getVar('dirname').'/">'.$this->getVar('name').'</a>'; |
|
| 169 | 169 | |
| 170 | 170 | return $ret; |
| 171 | 171 | } |
@@ -197,10 +197,10 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function loadAdminMenu() |
| 199 | 199 | { |
| 200 | - if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/' . $this->getInfo('adminmenu'))) { |
|
| 200 | + if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && file_exists(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$this->getInfo('adminmenu'))) { |
|
| 201 | 201 | $adminmenu = array(); |
| 202 | - include XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/' . $this->getInfo('adminmenu'); |
|
| 203 | - $this->adminmenu =& $adminmenu; |
|
| 202 | + include XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/'.$this->getInfo('adminmenu'); |
|
| 203 | + $this->adminmenu = & $adminmenu; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | return true; |
| 237 | 237 | } |
| 238 | 238 | global $xoopsConfig; |
| 239 | - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/' . $xoopsConfig['language'] . '/modinfo.php'))) { |
|
| 239 | + if (file_exists($file = $GLOBALS['xoops']->path('modules/'.$dirname.'/language/'.$xoopsConfig['language'].'/modinfo.php'))) { |
|
| 240 | 240 | include_once $file; |
| 241 | - } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) { |
|
| 241 | + } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/'.$dirname.'/language/english/modinfo.php'))) { |
|
| 242 | 242 | include_once $file; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - if (!file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/xoops_version.php'))) { |
|
| 245 | + if (!file_exists($file = $GLOBALS['xoops']->path('modules/'.$dirname.'/xoops_version.php'))) { |
|
| 246 | 246 | if (false !== (bool)$verbose) { |
| 247 | 247 | echo "Module File for $dirname Not Found!"; |
| 248 | 248 | } |
@@ -271,11 +271,11 @@ discard block |
||
| 271 | 271 | if ($this->getVar('hassearch') != 1) { |
| 272 | 272 | return false; |
| 273 | 273 | } |
| 274 | - $search =& $this->getInfo('search'); |
|
| 274 | + $search = & $this->getInfo('search'); |
|
| 275 | 275 | if ($this->getVar('hassearch') != 1 || !isset($search['file']) || !isset($search['func']) || $search['func'] == '' || $search['file'] == '') { |
| 276 | 276 | return false; |
| 277 | 277 | } |
| 278 | - if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { |
|
| 278 | + if (file_exists($file = $GLOBALS['xoops']->path('modules/'.$this->getVar('dirname').'/'.$search['file']))) { |
|
| 279 | 279 | include_once $file; |
| 280 | 280 | } else { |
| 281 | 281 | return false; |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | public function checkAccess() |
| 452 | 452 | { |
| 453 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 453 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 454 | 454 | |
| 455 | 455 | return false; |
| 456 | 456 | } |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | public function loadLanguage($type = 'main') |
| 464 | 464 | { |
| 465 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 465 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 466 | 466 | |
| 467 | 467 | return false; |
| 468 | 468 | } |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | */ |
| 473 | 473 | public function loadErrorMessages() |
| 474 | 474 | { |
| 475 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 475 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 476 | 476 | |
| 477 | 477 | return false; |
| 478 | 478 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | */ |
| 483 | 483 | public function getCurrentPage() |
| 484 | 484 | { |
| 485 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 485 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 486 | 486 | |
| 487 | 487 | return false; |
| 488 | 488 | } |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | */ |
| 496 | 496 | public function install($admingroups = array(), $accessgroups = array()) |
| 497 | 497 | { |
| 498 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 498 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 499 | 499 | |
| 500 | 500 | return false; |
| 501 | 501 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | */ |
| 506 | 506 | public function update() |
| 507 | 507 | { |
| 508 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 508 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 509 | 509 | |
| 510 | 510 | return false; |
| 511 | 511 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | */ |
| 516 | 516 | public function insert() |
| 517 | 517 | { |
| 518 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 518 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 519 | 519 | |
| 520 | 520 | return false; |
| 521 | 521 | } |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | */ |
| 526 | 526 | public function executeSQL() |
| 527 | 527 | { |
| 528 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 528 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 529 | 529 | |
| 530 | 530 | return false; |
| 531 | 531 | } |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | */ |
| 536 | 536 | public function insertTemplates() |
| 537 | 537 | { |
| 538 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 538 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 539 | 539 | |
| 540 | 540 | return false; |
| 541 | 541 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | */ |
| 549 | 549 | public function gettemplate($template, $block = false) |
| 550 | 550 | { |
| 551 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 551 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 552 | 552 | |
| 553 | 553 | return false; |
| 554 | 554 | } |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | */ |
| 559 | 559 | public function insertBlocks() |
| 560 | 560 | { |
| 561 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 561 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 562 | 562 | |
| 563 | 563 | return false; |
| 564 | 564 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | public function insertConfigCategories() |
| 570 | 570 | { |
| 571 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 571 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 572 | 572 | |
| 573 | 573 | return false; |
| 574 | 574 | } |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | */ |
| 579 | 579 | public function insertConfig() |
| 580 | 580 | { |
| 581 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 581 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 582 | 582 | |
| 583 | 583 | return false; |
| 584 | 584 | } |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | */ |
| 589 | 589 | public function insertProfileFields() |
| 590 | 590 | { |
| 591 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 591 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 592 | 592 | |
| 593 | 593 | return false; |
| 594 | 594 | } |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | */ |
| 602 | 602 | public function executeScript($type, $state = 2) |
| 603 | 603 | { |
| 604 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 604 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 605 | 605 | |
| 606 | 606 | return false; |
| 607 | 607 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | */ |
| 615 | 615 | public function insertGroupPermissions($groups, $type) |
| 616 | 616 | { |
| 617 | - trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
|
| 617 | + trigger_error(__CLASS__.'::'.__FUNCTION__.' is deprecated', E_USER_WARNING); |
|
| 618 | 618 | |
| 619 | 619 | return false; |
| 620 | 620 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | if (!empty($_cachedModule_mid[$id])) { |
| 684 | 684 | return $_cachedModule_mid[$id]; |
| 685 | 685 | } else { |
| 686 | - $sql = 'SELECT * FROM ' . $this->db->prefix('modules') . ' WHERE mid = ' . $id; |
|
| 686 | + $sql = 'SELECT * FROM '.$this->db->prefix('modules').' WHERE mid = '.$id; |
|
| 687 | 687 | if (!$result = $this->db->query($sql)) { |
| 688 | 688 | return $module; |
| 689 | 689 | } |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | return $_cachedModule_dirname[$dirname]; |
| 723 | 723 | } else { |
| 724 | 724 | $module = false; |
| 725 | - $sql = 'SELECT * FROM ' . $this->db->prefix('modules') . " WHERE dirname = '" . trim($dirname) . "'"; |
|
| 725 | + $sql = 'SELECT * FROM '.$this->db->prefix('modules')." WHERE dirname = '".trim($dirname)."'"; |
|
| 726 | 726 | if (!$result = $this->db->query($sql)) { |
| 727 | 727 | return $module; |
| 728 | 728 | } |
@@ -731,8 +731,8 @@ discard block |
||
| 731 | 731 | $module = new XoopsModule(); |
| 732 | 732 | $myrow = $this->db->fetchArray($result); |
| 733 | 733 | $module->assignVars($myrow); |
| 734 | - $_cachedModule_dirname[$dirname] =& $module; |
|
| 735 | - $_cachedModule_mid[$module->getVar('mid')] =& $module; |
|
| 734 | + $_cachedModule_dirname[$dirname] = & $module; |
|
| 735 | + $_cachedModule_mid[$module->getVar('mid')] = & $module; |
|
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | return $module; |
@@ -856,10 +856,10 @@ discard block |
||
| 856 | 856 | { |
| 857 | 857 | $ret = array(); |
| 858 | 858 | $limit = $start = 0; |
| 859 | - $sql = 'SELECT * FROM ' . $this->db->prefix('modules'); |
|
| 859 | + $sql = 'SELECT * FROM '.$this->db->prefix('modules'); |
|
| 860 | 860 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 861 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 862 | - $sql .= ' ORDER BY weight ' . $criteria->getOrder() . ', mid ASC'; |
|
| 861 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 862 | + $sql .= ' ORDER BY weight '.$criteria->getOrder().', mid ASC'; |
|
| 863 | 863 | $limit = $criteria->getLimit(); |
| 864 | 864 | $start = $criteria->getStart(); |
| 865 | 865 | } |
@@ -871,9 +871,9 @@ discard block |
||
| 871 | 871 | $module = new XoopsModule(); |
| 872 | 872 | $module->assignVars($myrow); |
| 873 | 873 | if (!$id_as_key) { |
| 874 | - $ret[] =& $module; |
|
| 874 | + $ret[] = & $module; |
|
| 875 | 875 | } else { |
| 876 | - $ret[$myrow['mid']] =& $module; |
|
| 876 | + $ret[$myrow['mid']] = & $module; |
|
| 877 | 877 | } |
| 878 | 878 | unset($module); |
| 879 | 879 | } |
@@ -889,9 +889,9 @@ discard block |
||
| 889 | 889 | */ |
| 890 | 890 | public function getCount(CriteriaElement $criteria = null) |
| 891 | 891 | { |
| 892 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('modules'); |
|
| 892 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('modules'); |
|
| 893 | 893 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 894 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 894 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 895 | 895 | } |
| 896 | 896 | if (!$result = $this->db->query($sql)) { |
| 897 | 897 | return 0; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * SOFTWARE. |
| 58 | 58 | */ |
| 59 | 59 | |
| 60 | -include __DIR__ . '/mainfile.php'; |
|
| 60 | +include __DIR__.'/mainfile.php'; |
|
| 61 | 61 | $xoopsLogger->activated = false; |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | XoopsLoad::load('fineuploadhandler', 'system'); |
| 89 | 89 | |
| 90 | 90 | $handler = (property_exists($claims, 'handler')) ? $claims->handler : 'fineuploadhandler'; |
| 91 | -$moddir = (property_exists($claims, 'moddir')) ? $claims->moddir : 'system'; |
|
| 91 | +$moddir = (property_exists($claims, 'moddir')) ? $claims->moddir : 'system'; |
|
| 92 | 92 | |
| 93 | 93 | XoopsLoad::load($handler, $moddir); |
| 94 | 94 | |
| 95 | -$className = $moddir . $handler; |
|
| 95 | +$className = $moddir.$handler; |
|
| 96 | 96 | /* $uploader XoopsFineUploadHandler */ |
| 97 | 97 | $uploader = new $className($claims); |
| 98 | 98 | |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | // Assumes you have a chunking.success.endpoint set to point here with a query parameter of "done". |
| 117 | 117 | // For example: /myserver/handlers/endpoint.php?done |
| 118 | 118 | if (isset($_GET["done"])) { |
| 119 | - $result = $uploader->combineChunks(XOOPS_ROOT_PATH . "/uploads"); |
|
| 119 | + $result = $uploader->combineChunks(XOOPS_ROOT_PATH."/uploads"); |
|
| 120 | 120 | } else { // Handle upload requests |
| 121 | 121 | // Call handleUpload() with the name of the folder, relative to PHP's getcwd() |
| 122 | - $result = $uploader->handleUpload(XOOPS_ROOT_PATH . "/uploads"); |
|
| 122 | + $result = $uploader->handleUpload(XOOPS_ROOT_PATH."/uploads"); |
|
| 123 | 123 | |
| 124 | 124 | // To return a name used for uploaded file you can use the following line. |
| 125 | 125 | $result["uploadName"] = $uploader->getUploadName(); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | include '../../../include/cp_header.php'; |
| 3 | 3 | include 'admin_header.php'; |
| 4 | -require_once dirname(__DIR__) . '/class/gtickets.php'; |
|
| 4 | +require_once dirname(__DIR__).'/class/gtickets.php'; |
|
| 5 | 5 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
| 6 | 6 | |
| 7 | 7 | // COPY TABLES |
@@ -12,13 +12,13 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // Ticket check |
| 14 | 14 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
| 15 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
| 15 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - $new_prefix = empty($_POST['new_prefix']) ? 'x' . substr(md5(time()), -5) : $_POST['new_prefix']; |
|
| 18 | + $new_prefix = empty($_POST['new_prefix']) ? 'x'.substr(md5(time()), -5) : $_POST['new_prefix']; |
|
| 19 | 19 | $old_prefix = $_POST['old_prefix']; |
| 20 | 20 | |
| 21 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . XOOPS_DB_NAME . '`'); |
|
| 21 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.XOOPS_DB_NAME.'`'); |
|
| 22 | 22 | |
| 23 | 23 | if (!$db->getRowsNum($srs)) { |
| 24 | 24 | die('You are not allowed to copy tables'); |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | while (false !== ($row_table = $db->fetchArray($srs))) { |
| 29 | 29 | ++$count; |
| 30 | 30 | $old_table = $row_table['Name']; |
| 31 | - if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix . '_') { |
|
| 31 | + if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix.'_') { |
|
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - $new_table = $new_prefix . substr($old_table, strlen($old_prefix)); |
|
| 35 | + $new_table = $new_prefix.substr($old_table, strlen($old_prefix)); |
|
| 36 | 36 | |
| 37 | - $crs = $db->queryF('SHOW CREATE TABLE ' . $old_table); |
|
| 37 | + $crs = $db->queryF('SHOW CREATE TABLE '.$old_table); |
|
| 38 | 38 | if (!$db->getRowsNum($crs)) { |
| 39 | 39 | echo "error: SHOW CREATE TABLE ($old_table)<br>\n"; |
| 40 | 40 | continue; |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | // Ticket check |
| 70 | 70 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
| 71 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
| 71 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $prefix = $_POST['prefix']; |
| 75 | 75 | |
| 76 | 76 | // get table list |
| 77 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . XOOPS_DB_NAME . '`'); |
|
| 77 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.XOOPS_DB_NAME.'`'); |
|
| 78 | 78 | if (!$db->getRowsNum($srs)) { |
| 79 | 79 | die('You are not allowed to delete tables'); |
| 80 | 80 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | while (false !== ($row_table = $db->fetchArray($srs))) { |
| 86 | 86 | $table = $row_table['Name']; |
| 87 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
| 87 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
| 88 | 88 | continue; |
| 89 | 89 | } |
| 90 | 90 | $drawCreate = $db->queryF("SHOW CREATE TABLE `$table`"); |
@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $insertValues = ''; |
| 99 | 99 | |
| 100 | - if ($db->getRowsNum($result)>0) { |
|
| 100 | + if ($db->getRowsNum($result) > 0) { |
|
| 101 | 101 | $fieldInfo = array(); |
| 102 | 102 | $insertNames = "INSERT INTO `$table` ("; |
| 103 | 103 | for ($j = 0; $j < $fieldCount; ++$j) { |
| 104 | 104 | $field = $result->fetch_field_direct($j); |
| 105 | 105 | $fieldInfo[$field->name] = $field; |
| 106 | - $insertNames .= ((0 === $j) ? '' : ', ') . $field->name; |
|
| 106 | + $insertNames .= ((0 === $j) ? '' : ', ').$field->name; |
|
| 107 | 107 | } |
| 108 | 108 | $insertNames .= ")\nVALUES\n"; |
| 109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $insertValues = $insertNames; |
| 112 | 112 | while (false !== ($row = $db->fetchArray($result))) { |
| 113 | 113 | if ($rowCount >= $rowLimit) { |
| 114 | - $insertValues .= ");\n\n" . $insertNames; |
|
| 114 | + $insertValues .= ");\n\n".$insertNames; |
|
| 115 | 115 | $rowCount = 0; |
| 116 | 116 | } |
| 117 | 117 | $insertValues .= (0 === $rowCount++) ? '(' : "),\n("; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | break; |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | - $insertValues .= ($firstField ? '' : ', ') . $value; |
|
| 144 | + $insertValues .= ($firstField ? '' : ', ').$value; |
|
| 145 | 145 | $firstField = false; |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | header('Content-Type: Application/octet-stream'); |
| 156 | - header('Content-Disposition: attachment; filename="' . $prefix . '_' . date('YmdHis') . '.sql"'); |
|
| 157 | - header('Content-Length: ' . strlen($exportString)); |
|
| 156 | + header('Content-Disposition: attachment; filename="'.$prefix.'_'.date('YmdHis').'.sql"'); |
|
| 157 | + header('Content-Length: '.strlen($exportString)); |
|
| 158 | 158 | set_time_limit(0); |
| 159 | 159 | echo $exportString; |
| 160 | 160 | exit; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | // Ticket check |
| 169 | 169 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
| 170 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
| 170 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $prefix = $_POST['prefix']; |
@@ -184,14 +184,14 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | // get table list |
| 187 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . XOOPS_DB_NAME . '`'); |
|
| 187 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.XOOPS_DB_NAME.'`'); |
|
| 188 | 188 | if (!$db->getRowsNum($srs)) { |
| 189 | 189 | die('You are not allowed to delete tables'); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | while (false !== ($row_table = $db->fetchArray($srs))) { |
| 193 | 193 | $table = $row_table['Name']; |
| 194 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
| 194 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
| 195 | 195 | continue; |
| 196 | 196 | } |
| 197 | 197 | $drs = $db->queryF("DROP TABLE `$table`"); |
@@ -205,10 +205,10 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | // beggining of Output |
| 207 | 207 | xoops_cp_header(); |
| 208 | -include __DIR__ . '/mymenu.php'; |
|
| 208 | +include __DIR__.'/mymenu.php'; |
|
| 209 | 209 | |
| 210 | 210 | // query |
| 211 | -$srs = $db->queryF('SHOW TABLE STATUS FROM `' . XOOPS_DB_NAME . '`'); |
|
| 211 | +$srs = $db->queryF('SHOW TABLE STATUS FROM `'.XOOPS_DB_NAME.'`'); |
|
| 212 | 212 | if (!$db->getRowsNum($srs)) { |
| 213 | 213 | die('You are not allowed to copy tables'); |
| 214 | 214 | xoops_cp_footer(); |
@@ -229,14 +229,14 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | // table |
| 231 | 231 | echo ' |
| 232 | -<h3>' . _AM_H3_PREFIXMAN . "</h3> |
|
| 232 | +<h3>' . _AM_H3_PREFIXMAN."</h3> |
|
| 233 | 233 | <table class='outer' width='95%'> |
| 234 | 234 | <tr> |
| 235 | - <th>" . _AM_PROTECTOR_PREFIX . '</th> |
|
| 236 | - <th>' . _AM_PROTECTOR_TABLES . '</th> |
|
| 237 | - <th>' . _AM_PROTECTOR_UPDATED . '</th> |
|
| 238 | - <th>' . _AM_PROTECTOR_COPY . '</th> |
|
| 239 | - <th>' . _AM_PROTECTOR_ACTIONS . '</th> |
|
| 235 | + <th>" . _AM_PROTECTOR_PREFIX.'</th> |
|
| 236 | + <th>' . _AM_PROTECTOR_TABLES.'</th> |
|
| 237 | + <th>' . _AM_PROTECTOR_UPDATED.'</th> |
|
| 238 | + <th>' . _AM_PROTECTOR_COPY.'</th> |
|
| 239 | + <th>' . _AM_PROTECTOR_ACTIONS.'</th> |
|
| 240 | 240 | </tr> |
| 241 | 241 | '; |
| 242 | 242 | |
@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | $table_count = 0; |
| 247 | 247 | $has_xoopscomments = false; |
| 248 | 248 | foreach ($tables as $table) { |
| 249 | - if ($table == $prefix['name'] . '_xoopscomments') { |
|
| 249 | + if ($table == $prefix['name'].'_xoopscomments') { |
|
| 250 | 250 | $has_xoopscomments = true; |
| 251 | 251 | } |
| 252 | - if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'] . '_') { |
|
| 252 | + if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'].'_') { |
|
| 253 | 253 | ++$table_count; |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $del_button = ''; |
| 267 | 267 | $style_append = 'background-color:#FFFFFF'; |
| 268 | 268 | } else { |
| 269 | - $del_button = "<input type='submit' name='delete' value='delete' onclick='return confirm(\"" . _AM_CONFIRM_DELETE . "\")' />"; |
|
| 269 | + $del_button = "<input type='submit' name='delete' value='delete' onclick='return confirm(\""._AM_CONFIRM_DELETE."\")' />"; |
|
| 270 | 270 | $style_append = ''; |
| 271 | 271 | } |
| 272 | 272 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | |
| 297 | 297 | echo ' |
| 298 | 298 | </table> |
| 299 | -<p>' . sprintf(_AM_TXT_HOWTOCHANGEDB, XOOPS_ROOT_PATH, XOOPS_DB_PREFIX) . '</p> |
|
| 299 | +<p>' . sprintf(_AM_TXT_HOWTOCHANGEDB, XOOPS_ROOT_PATH, XOOPS_DB_PREFIX).'</p> |
|
| 300 | 300 | |
| 301 | 301 | '; |
| 302 | 302 | |
@@ -125,7 +125,7 @@ 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 | ); |
@@ -224,7 +224,7 @@ discard block |
||
| 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 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | spl_autoload_register('__autoload'); |
| 15 | 15 | } |
| 16 | 16 | } elseif (!function_exists('__autoload')) { |
| 17 | - require dirname(__FILE__) . '/HTMLPurifier.autoload-legacy.php'; |
|
| 17 | + require dirname(__FILE__).'/HTMLPurifier.autoload-legacy.php'; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | if (ini_get('zend.ze1_compatibility_mode')) { |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function __construct($n = '0', $u = false) |
| 44 | 44 | { |
| 45 | - $this->n = (string) $n; |
|
| 46 | - $this->unit = $u !== false ? (string) $u : false; |
|
| 45 | + $this->n = (string)$n; |
|
| 46 | + $this->unit = $u !== false ? (string)$u : false; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if (!$this->isValid()) { |
| 104 | 104 | return false; |
| 105 | 105 | } |
| 106 | - return $this->n . $this->unit; |
|
| 106 | + return $this->n.$this->unit; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($filename[0] === '.') { |
| 111 | 111 | continue; |
| 112 | 112 | } |
| 113 | - unlink($dir . '/' . $filename); |
|
| 113 | + unlink($dir.'/'.$filename); |
|
| 114 | 114 | } |
| 115 | 115 | closedir($dh); |
| 116 | 116 | return true; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | $key = substr($filename, 0, strlen($filename) - 4); |
| 142 | 142 | if ($this->isOld($key, $config)) { |
| 143 | - unlink($dir . '/' . $filename); |
|
| 143 | + unlink($dir.'/'.$filename); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | closedir($dh); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | public function generateFilePath($config) |
| 158 | 158 | { |
| 159 | 159 | $key = $this->generateKey($config); |
| 160 | - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; |
|
| 160 | + return $this->generateDirectoryPath($config).'/'.$key.'.ser'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function generateDirectoryPath($config) |
| 171 | 171 | { |
| 172 | 172 | $base = $this->generateBaseDirectoryPath($config); |
| 173 | - return $base . '/' . $this->type; |
|
| 173 | + return $base.'/'.$this->type; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | if ($chmod === null) { |
| 220 | 220 | if (!@mkdir($directory) && !is_dir($directory)) { |
| 221 | 221 | trigger_error( |
| 222 | - 'Could not create directory ' . $directory . '', |
|
| 222 | + 'Could not create directory '.$directory.'', |
|
| 223 | 223 | E_USER_WARNING |
| 224 | 224 | ); |
| 225 | 225 | return false; |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $base = $this->generateBaseDirectoryPath($config); |
| 231 | 231 | if (!is_dir($base)) { |
| 232 | 232 | trigger_error( |
| 233 | - 'Base directory ' . $base . ' does not exist, |
|
| 233 | + 'Base directory '.$base.' does not exist, |
|
| 234 | 234 | please create or change using %Cache.SerializerPath', |
| 235 | 235 | E_USER_WARNING |
| 236 | 236 | ); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | if (!@mkdir($directory, $chmod) && !is_dir($directory)) { |
| 242 | 242 | trigger_error( |
| 243 | - 'Could not create directory ' . $directory . '', |
|
| 243 | + 'Could not create directory '.$directory.'', |
|
| 244 | 244 | E_USER_WARNING |
| 245 | 245 | ); |
| 246 | 246 | return false; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | // generally, you'll want to handle this beforehand |
| 272 | 272 | // so a more specific error message can be given |
| 273 | 273 | trigger_error( |
| 274 | - 'Directory ' . $dir . ' does not exist', |
|
| 274 | + 'Directory '.$dir.' does not exist', |
|
| 275 | 275 | E_USER_WARNING |
| 276 | 276 | ); |
| 277 | 277 | return false; |
@@ -292,14 +292,14 @@ discard block |
||
| 292 | 292 | $chmod = $chmod | 0777; |
| 293 | 293 | } |
| 294 | 294 | trigger_error( |
| 295 | - 'Directory ' . $dir . ' not writable, ' . |
|
| 296 | - 'please chmod to ' . decoct($chmod), |
|
| 295 | + 'Directory '.$dir.' not writable, '. |
|
| 296 | + 'please chmod to '.decoct($chmod), |
|
| 297 | 297 | E_USER_WARNING |
| 298 | 298 | ); |
| 299 | 299 | } else { |
| 300 | 300 | // generic error message |
| 301 | 301 | trigger_error( |
| 302 | - 'Directory ' . $dir . ' not writable, ' . |
|
| 302 | + 'Directory '.$dir.' not writable, '. |
|
| 303 | 303 | 'please alter file permissions', |
| 304 | 304 | E_USER_WARNING |
| 305 | 305 | ); |