@@ -28,7 +28,7 @@ |
||
| 28 | 28 | if ($protector->ip_matched_info) { |
| 29 | 29 | printf(_MD_PROTECTOR_FMT_JAILINFO, date(_MD_PROTECTOR_FMT_JAILTIME, $protector->ip_matched_info)); |
| 30 | 30 | } |
| 31 | - error_log('Protector: badip ' . @$_SERVER['REMOTE_ADDR'], 0); |
|
| 31 | + error_log('Protector: badip '.@$_SERVER['REMOTE_ADDR'], 0); |
|
| 32 | 32 | exit; |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | function execute() |
| 29 | 29 | { |
| 30 | - header('Location: ' . PROTECTOR_BADIP_REDIRECTION_URI); |
|
| 30 | + header('Location: '.PROTECTOR_BADIP_REDIRECTION_URI); |
|
| 31 | 31 | exit; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | header('Retry-After: 600'); |
| 28 | 28 | |
| 29 | 29 | echo _MD_PROTECTOR_BANDWIDTHLIMITED; |
| 30 | - error_log('Protector: bwlimit ' . @$_SERVER['REMOTE_ADDR'], 0); |
|
| 30 | + error_log('Protector: bwlimit '.@$_SERVER['REMOTE_ADDR'], 0); |
|
| 31 | 31 | exit; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); |
| 40 | 40 | |
| 41 | 41 | foreach ($rbls as $rbl) { |
| 42 | - $host = $rev_ip . '.' . $rbl; |
|
| 42 | + $host = $rev_ip.'.'.$rbl; |
|
| 43 | 43 | if (gethostbyname($host) != $host) { |
| 44 | 44 | $this->protector->message .= "DENY by $rbl\n"; |
| 45 | 45 | $uid = $xoops->isUser() ? $xoops->user->getVar('uid') : 0; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | // http:bl servers (don't enable too many servers) |
| 32 | 32 | $rbls = array( |
| 33 | - 'http:BL' => PROTECTOR_HTTPBL_KEY . '.%s.dnsbl.httpbl.org', |
|
| 33 | + 'http:BL' => PROTECTOR_HTTPBL_KEY.'.%s.dnsbl.httpbl.org', |
|
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $antispam_htmls = $this->getHtml4Assign(); |
| 41 | 41 | |
| 42 | - return preg_replace('/<form[^>]*action=["\'](|#|register.php)["\'][^>]+>/i', '$0' . "\n" . $antispam_htmls['html_in_form'] . "\n" . $antispam_htmls['js_global'], $s, 1); |
|
| 42 | + return preg_replace('/<form[^>]*action=["\'](|#|register.php)["\'][^>]+>/i', '$0'."\n".$antispam_htmls['html_in_form']."\n".$antispam_htmls['js_global'], $s, 1); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // import from D3forumAntispamDefault.clas.php |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if (empty($time)) { |
| 53 | 53 | $time = time(); |
| 54 | 54 | } |
| 55 | - return md5(gmdate('YmdH', $time) . \XoopsBaseConfig::get('db-prefix') . \XoopsBaseConfig::get('db-name')); |
|
| 55 | + return md5(gmdate('YmdH', $time).\XoopsBaseConfig::get('db-prefix').\XoopsBaseConfig::get('db-name')); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | function getHtml4Assign() |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | return array( |
| 85 | 85 | 'html_in_form' => '<input type="hidden" name="antispam_md5" id="antispam_md5" value="" />', |
| 86 | - 'js_global' => '<script type="text/javascript"><!--//' . "\n" . $js_in_validate_function . "\n" . '//--></script><noscript><div class="errorMsg">' . _MD_PROTECTOR_TURNJAVASCRIPTON . '</div></noscript>', |
|
| 86 | + 'js_global' => '<script type="text/javascript"><!--//'."\n".$js_in_validate_function."\n".'//--></script><noscript><div class="errorMsg">'._MD_PROTECTOR_TURNJAVASCRIPTON.'</div></noscript>', |
|
| 87 | 87 | ); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | static function eventCoreClassDatabaseDatabasefactoryConnection($args) |
| 62 | 62 | { |
| 63 | 63 | // Protector class |
| 64 | - require_once dirname(__DIR__) . '/class/protector.php'; |
|
| 64 | + require_once dirname(__DIR__).'/class/protector.php'; |
|
| 65 | 65 | |
| 66 | 66 | // Protector object |
| 67 | 67 | $protector = Protector::getInstance(); |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // configs writable check |
| 42 | - if (@$_SERVER['REQUEST_URI'] === '/admin.php' && !is_writable(dirname(__DIR__) . '/configs')) { |
|
| 43 | - trigger_error('You should turn the directory ' . dirname(__DIR__) . '/configs writable', E_USER_WARNING); |
|
| 42 | + if (@$_SERVER['REQUEST_URI'] === '/admin.php' && !is_writable(dirname(__DIR__).'/configs')) { |
|
| 43 | + trigger_error('You should turn the directory '.dirname(__DIR__).'/configs writable', E_USER_WARNING); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Protector object |
| 47 | - require_once dirname(__DIR__) . '/class/protector.php'; |
|
| 47 | + require_once dirname(__DIR__).'/class/protector.php'; |
|
| 48 | 48 | $protector = Protector::getInstance(); |
| 49 | 49 | |
| 50 | 50 | $protector->setConn($xoopsDB->conn); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // http://larholm.com/2007/06/11/phpmailer-0day-remote-execution/ |
| 59 | 59 | if (in_array(substr(XOOPS_VERSION, 0, 12), array('XOOPS 2.0.16', 'XOOPS 2.0.13', 'XOOPS 2.2.4'))) { |
| 60 | 60 | $xoopsMailerConfig = $xoops->getConfigs(); |
| 61 | - if ($xoopsMailerConfig['mailmethod'] === 'sendmail' && md5_file(\XoopsBaseConfig::get('root-path') . '/class/mail/phpmailer/class.phpmailer.php') === 'ee1c09a8e579631f0511972f929fe36a') { |
|
| 61 | + if ($xoopsMailerConfig['mailmethod'] === 'sendmail' && md5_file(\XoopsBaseConfig::get('root-path').'/class/mail/phpmailer/class.phpmailer.php') === 'ee1c09a8e579631f0511972f929fe36a') { |
|
| 62 | 62 | echo '<strong>phpmailer security hole! Change the preferences of mail from "sendmail" to another, or upgrade the core right now! (message by protector)</strong>'; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $reliable_ips = @unserialize(@$conf['reliable_ips']); |
| 84 | 84 | if (is_array($reliable_ips)) { |
| 85 | 85 | foreach ($reliable_ips as $reliable_ip) { |
| 86 | - if (!empty($reliable_ip) && preg_match('/' . $reliable_ip . '/', $_SERVER['REMOTE_ADDR'])) { |
|
| 86 | + if (!empty($reliable_ip) && preg_match('/'.$reliable_ip.'/', $_SERVER['REMOTE_ADDR'])) { |
|
| 87 | 87 | return true; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // register.php Protection |
| 208 | - if ($_SERVER['SCRIPT_FILENAME'] == \XoopsBaseConfig::get('root-path') . '/register.php') { |
|
| 208 | + if ($_SERVER['SCRIPT_FILENAME'] == \XoopsBaseConfig::get('root-path').'/register.php') { |
|
| 209 | 209 | $protector->call_filter('postcommon_register'); |
| 210 | 210 | } |
| 211 | 211 | |
@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | function protector_precheck() |
| 26 | 26 | { |
| 27 | 27 | // check the access is from install/index.php |
| 28 | - if (defined('_INSTALL_CHARSET') && !is_writable(\XoopsBaseConfig::get('root-path') . '/mainfile.php')) { |
|
| 28 | + if (defined('_INSTALL_CHARSET') && !is_writable(\XoopsBaseConfig::get('root-path').'/mainfile.php')) { |
|
| 29 | 29 | die('To use installer, remove protector\'s lines from mainfile.php first.'); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // Protector class |
| 33 | - require_once dirname(__DIR__) . '/class/protector.php'; |
|
| 33 | + require_once dirname(__DIR__).'/class/protector.php'; |
|
| 34 | 34 | |
| 35 | 35 | // Protector object |
| 36 | 36 | $protector = Protector::getInstance(); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | $is_reliable = false; |
| 70 | 70 | foreach ($reliable_ips as $reliable_ip) { |
| 71 | - if (!empty($reliable_ip) && preg_match('/' . $reliable_ip . '/', $_SERVER['REMOTE_ADDR'])) { |
|
| 71 | + if (!empty($reliable_ip) && preg_match('/'.$reliable_ip.'/', $_SERVER['REMOTE_ADDR'])) { |
|
| 72 | 72 | $is_reliable = true; |
| 73 | 73 | } |
| 74 | 74 | } |