@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $this->pdfKeywords = $pdfKeywords; |
345 | 345 | if (isset($this->pdfEngine)) { |
346 | 346 | $keywords = |
347 | - is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string) $this->pdfKeywords; |
|
347 | + is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string)$this->pdfKeywords; |
|
348 | 348 | $this->pdfEngine->SetKeywords($keywords); |
349 | 349 | } |
350 | 350 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | if (isset($this->pdfKeywords)) { |
437 | 437 | $keywords = |
438 | - is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string) $this->pdfKeywords; |
|
438 | + is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string)$this->pdfKeywords; |
|
439 | 439 | $this->pdfEngine->SetKeywords($keywords); |
440 | 440 | } |
441 | 441 | if (!empty($this->pdfCreator)) { |
@@ -466,21 +466,21 @@ discard block |
||
466 | 466 | */ |
467 | 467 | private function decodeEntities($text) |
468 | 468 | { |
469 | - $text= html_entity_decode($text, ENT_QUOTES, "UTF-8"); |
|
470 | - $text= preg_replace_callback( |
|
469 | + $text = html_entity_decode($text, ENT_QUOTES, "UTF-8"); |
|
470 | + $text = preg_replace_callback( |
|
471 | 471 | '/&#(\d+);/m', |
472 | - function ($m) { |
|
472 | + function($m) { |
|
473 | 473 | return utf8_encode(chr($m[1])); |
474 | 474 | }, |
475 | 475 | $text |
476 | 476 | ); // decimal notation |
477 | - $text= preg_replace_callback( |
|
477 | + $text = preg_replace_callback( |
|
478 | 478 | '/&#x([a-f0-9]+);/mi', |
479 | - function ($m) { |
|
479 | + function($m) { |
|
480 | 480 | return utf8_encode(chr('0x'.$m[1])); |
481 | 481 | }, |
482 | 482 | $text |
483 | - ); //hex notation |
|
483 | + ); //hex notation |
|
484 | 484 | return $text; |
485 | 485 | } |
486 | 486 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $xoops->header(); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | -require_once dirname(__DIR__) . '/class/gtickets.php'; |
|
24 | +require_once dirname(__DIR__).'/class/gtickets.php'; |
|
25 | 25 | |
26 | 26 | $xoops = Xoops::getInstance(); |
27 | 27 | $xoops->db(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | // Ticket check |
43 | 43 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
44 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
44 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
45 | 45 | } |
46 | 46 | |
47 | - $new_prefix = empty($_POST['new_prefix']) ? 'x' . substr(md5(time()), -5) : $_POST['new_prefix']; |
|
47 | + $new_prefix = empty($_POST['new_prefix']) ? 'x'.substr(md5(time()), -5) : $_POST['new_prefix']; |
|
48 | 48 | $old_prefix = $_POST['old_prefix']; |
49 | 49 | |
50 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
50 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
51 | 51 | |
52 | 52 | if (!$db->getRowsNum($srs)) { |
53 | 53 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NACT); |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | while (false !== ($row_table = $db->fetchArray($srs))) { |
60 | 60 | ++$count; |
61 | 61 | $old_table = $row_table['Name']; |
62 | - if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix . '_') { |
|
62 | + if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix.'_') { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - $new_table = $new_prefix . substr($old_table, strlen($old_prefix)); |
|
66 | + $new_table = $new_prefix.substr($old_table, strlen($old_prefix)); |
|
67 | 67 | |
68 | - $crs = $db->queryF('SHOW CREATE TABLE ' . $old_table); |
|
68 | + $crs = $db->queryF('SHOW CREATE TABLE '.$old_table); |
|
69 | 69 | if (!$db->getRowsNum($crs)) { |
70 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_SCT, $old_table) . '<br />'; |
|
70 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_SCT, $old_table).'<br />'; |
|
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | $row_create = $db->fetchArray($crs); |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | |
76 | 76 | $crs = $db->queryF($create_sql); |
77 | 77 | if (!$crs) { |
78 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_CT, $new_table) . '<br />'; |
|
78 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_CT, $new_table).'<br />'; |
|
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | |
82 | 82 | $irs = $db->queryF("INSERT INTO `$new_table` SELECT * FROM `$old_table`"); |
83 | 83 | if (!$irs) { |
84 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_II, $new_table) . '<br />'; |
|
84 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_II, $new_table).'<br />'; |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | |
108 | 108 | // Ticket check |
109 | 109 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
110 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
110 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $prefix = $_POST['prefix']; |
114 | 114 | |
115 | 115 | // get table list |
116 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
116 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
117 | 117 | if (!$db->getRowsNum($srs)) { |
118 | 118 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NADT); |
119 | 119 | $xoops->footer(); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | |
125 | 125 | while (false !== ($row_table = $db->fetchArray($srs))) { |
126 | 126 | $table = $row_table['Name']; |
127 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
127 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | $drs = $db->queryF("SHOW CREATE TABLE `$table`"); |
131 | - $export_string .= "\nDROP TABLE IF EXISTS `$table`;\n" . mysql_result($drs, 0, 1) . ";\n\n"; |
|
131 | + $export_string .= "\nDROP TABLE IF EXISTS `$table`;\n".mysql_result($drs, 0, 1).";\n\n"; |
|
132 | 132 | $result = mysqli_query("SELECT * FROM `$table`"); |
133 | 133 | $fields_cnt = mysql_num_fields($result); |
134 | 134 | $field_flags = array(); |
@@ -159,24 +159,24 @@ discard block |
||
159 | 159 | if (empty($row[$j]) && $row[$j] != '0') { |
160 | 160 | $values[] = '\'\''; |
161 | 161 | } else { |
162 | - $values[] = '0x' . bin2hex($row[$j]); |
|
162 | + $values[] = '0x'.bin2hex($row[$j]); |
|
163 | 163 | } |
164 | 164 | // something else -> treat as a string |
165 | 165 | } else { |
166 | - $values[] = '\'' . str_replace($search, $replace, addslashes($row[$j])) . '\''; |
|
166 | + $values[] = '\''.str_replace($search, $replace, addslashes($row[$j])).'\''; |
|
167 | 167 | } |
168 | 168 | } // end if |
169 | 169 | } // end for |
170 | 170 | |
171 | - $export_string .= "INSERT INTO `$table` VALUES (" . implode(', ', $values) . ");\n"; |
|
171 | + $export_string .= "INSERT INTO `$table` VALUES (".implode(', ', $values).");\n"; |
|
172 | 172 | unset($values); |
173 | 173 | } // end while |
174 | 174 | mysql_free_result($result); |
175 | 175 | } |
176 | 176 | |
177 | 177 | header('Content-Type: Application/octet-stream'); |
178 | - header('Content-Disposition: attachment; filename="' . $prefix . '_' . date('YmdHis') . '.sql"'); |
|
179 | - header('Content-Length: ' . strlen($export_string)); |
|
178 | + header('Content-Disposition: attachment; filename="'.$prefix.'_'.date('YmdHis').'.sql"'); |
|
179 | + header('Content-Length: '.strlen($export_string)); |
|
180 | 180 | set_time_limit(0); |
181 | 181 | echo $export_string; |
182 | 182 | exit; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | // Ticket check |
194 | 194 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
195 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
195 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $prefix = $_POST['prefix']; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | // get table list |
216 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
216 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
217 | 217 | if (!$db->getRowsNum($srs)) { |
218 | 218 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NADT); |
219 | 219 | $xoops->footer(); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | while (false !== ($row_table = $db->fetchArray($srs))) { |
224 | 224 | $table = $row_table['Name']; |
225 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
225 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
226 | 226 | continue; |
227 | 227 | } |
228 | 228 | $drs = $db->queryF("DROP TABLE `$table`"); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $admin_page = new \Xoops\Module\Admin(); |
242 | 242 | $admin_page->renderNavigation('prefix_manager.php'); |
243 | 243 | |
244 | -$xoops->tpl()->assign('prefix', sprintf(_AM_TXT_HOWTOCHANGEDB, \XoopsBaseConfig::get('var_path') . "/data/secure.php")); |
|
244 | +$xoops->tpl()->assign('prefix', sprintf(_AM_TXT_HOWTOCHANGEDB, \XoopsBaseConfig::get('var_path')."/data/secure.php")); |
|
245 | 245 | $xoops->tpl()->assign('prefix_line', sprintf(_AM_PROTECTOR_PREFIX_CHANGEDBLINE, \XoopsBaseConfig::get('db-prefix'))); |
246 | 246 | |
247 | 247 | // Display Log if exists |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | // query |
255 | -$srs = $db->queryF("SHOW TABLE STATUS FROM `" . \XoopsBaseConfig::get('db-name') . '`'); |
|
255 | +$srs = $db->queryF("SHOW TABLE STATUS FROM `".\XoopsBaseConfig::get('db-name').'`'); |
|
256 | 256 | if (!$db->getRowsNum($srs)) { |
257 | 257 | $xoops->tpl()->assign('error', '_AM_PROTECTOR_PREFIX_ERROR_NACT'); |
258 | 258 | $xoops->footer(); |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | $table_count = 0; |
279 | 279 | $has_xoopscomments = false; |
280 | 280 | foreach ($tables as $table) { |
281 | - if ($table == $prefix['name'] . '_xoopscomments') { |
|
281 | + if ($table == $prefix['name'].'_xoopscomments') { |
|
282 | 282 | $has_xoopscomments = true; |
283 | 283 | } |
284 | - if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'] . '_') { |
|
284 | + if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'].'_') { |
|
285 | 285 | ++$table_count; |
286 | 286 | } |
287 | 287 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | $xoops->db(); |
24 | 24 | global $xoopsDB; |
25 | 25 | $db = $xoopsDB; |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | break; |
44 | 44 | } |
45 | 45 | } |
46 | -$relative_path = str_repeat('../', count($root_paths) - $i) . implode('/', array_slice($trust_paths, $i)); |
|
46 | +$relative_path = str_repeat('../', count($root_paths) - $i).implode('/', array_slice($trust_paths, $i)); |
|
47 | 47 | $security_arr[$i]['id'] = $i + 1; |
48 | 48 | $security_arr[$i]['type'] = 'XOOPS_TRUST_PATH'; |
49 | 49 | $security_arr[$i]['status'] = '-'; |
50 | -$security_arr[$i]['info'] = "<img src='" . \XoopsBaseConfig::get('url') . '/' . htmlspecialchars($relative_path) . "/modules/protector/public_check.png' width='40' height='20' alt='' style='border:1px solid black;' /> <a href='" . \XoopsBaseConfig::get('url') . '/' . htmlspecialchars($relative_path) . "/modules/protector/public_check.php'>" . _AM_ADV_TRUSTPATHPUBLICLINK . "</a>"; |
|
50 | +$security_arr[$i]['info'] = "<img src='".\XoopsBaseConfig::get('url').'/'.htmlspecialchars($relative_path)."/modules/protector/public_check.png' width='40' height='20' alt='' style='border:1px solid black;' /> <a href='".\XoopsBaseConfig::get('url').'/'.htmlspecialchars($relative_path)."/modules/protector/public_check.php'>"._AM_ADV_TRUSTPATHPUBLICLINK."</a>"; |
|
51 | 51 | $security_arr[$i]['text'] = _AM_ADV_TRUSTPATHPUBLIC; |
52 | 52 | ++$i; |
53 | 53 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $security_arr[$i]['status'] = '0'; |
63 | 63 | $security_arr[$i]['info'] = "<span style='color:red;font-weight:bold;'>register_globals: on</span>"; |
64 | 64 | } |
65 | -$security_arr[$i]['text'] = _AM_ADV_REGISTERGLOBALS . "<br /><br />" . \XoopsBaseConfig::get('root-path') . "/.htaccess<br /><br />" . _AM_ADV_REGISTERGLOBALS2 . "<br /><br /><b>php_flag register_globals off</b>"; |
|
65 | +$security_arr[$i]['text'] = _AM_ADV_REGISTERGLOBALS."<br /><br />".\XoopsBaseConfig::get('root-path')."/.htaccess<br /><br />"._AM_ADV_REGISTERGLOBALS2."<br /><br /><b>php_flag register_globals off</b>"; |
|
66 | 66 | ++$i; |
67 | 67 | |
68 | 68 | // allow_url_fopen |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | $security_arr[$i]['type'] = 'XOOPS_DB_PREFIX'; |
100 | 100 | if ($safe) { |
101 | 101 | $security_arr[$i]['status'] = '1'; |
102 | - $security_arr[$i]['info'] = "<span style='color:green;font-weight:bold;'>XOOPS_DB_PREFIX: " . \XoopsBaseConfig::get('db-prefix') . "</span>"; |
|
102 | + $security_arr[$i]['info'] = "<span style='color:green;font-weight:bold;'>XOOPS_DB_PREFIX: ".\XoopsBaseConfig::get('db-prefix')."</span>"; |
|
103 | 103 | } else { |
104 | 104 | $security_arr[$i]['status'] = '0'; |
105 | - $security_arr[$i]['info'] = "<span style='color:red;font-weight:bold;'>XOOPS_DB_PREFIX: " . \XoopsBaseConfig::get('db-prefix') . "</span> <a href='prefix_manager.php'>" . _AM_ADV_LINK_TO_PREFIXMAN . "</a>"; |
|
105 | + $security_arr[$i]['info'] = "<span style='color:red;font-weight:bold;'>XOOPS_DB_PREFIX: ".\XoopsBaseConfig::get('db-prefix')."</span> <a href='prefix_manager.php'>"._AM_ADV_LINK_TO_PREFIXMAN."</a>"; |
|
106 | 106 | } |
107 | 107 | $security_arr[$i]['text'] = _AM_ADV_DBPREFIX; |
108 | 108 | ++$i; |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | $security_arr[$i]['type'] = 'databasefactory.php'; |
132 | 132 | if (substr(@XOOPS_VERSION, 6, 3) < 2.4 && strtolower(get_class($db)) !== 'protectormysqldatabase') { |
133 | 133 | $security_arr[$i]['status'] = '0'; |
134 | - $security_arr[$i]['info'] = "<span style='color:red;font-weight:bold;'>" . _AM_ADV_DBFACTORYUNPATCHED . "</span>"; |
|
134 | + $security_arr[$i]['info'] = "<span style='color:red;font-weight:bold;'>"._AM_ADV_DBFACTORYUNPATCHED."</span>"; |
|
135 | 135 | } else { |
136 | 136 | $security_arr[$i]['status'] = '1'; |
137 | - $security_arr[$i]['info'] = "<span style='color:green;font-weight:bold;'>" . _AM_ADV_DBFACTORYPATCHED . "</span>"; |
|
137 | + $security_arr[$i]['info'] = "<span style='color:green;font-weight:bold;'>"._AM_ADV_DBFACTORYPATCHED."</span>"; |
|
138 | 138 | } |
139 | 139 | $security_arr[$i]['text'] = ''; |
140 | 140 | ++$i; |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | // Check contaminations |
148 | -$uri_contami = \XoopsBaseConfig::get('url') . "/index.php?xoopsConfig%5Bnocommon%5D=1"; |
|
148 | +$uri_contami = \XoopsBaseConfig::get('url')."/index.php?xoopsConfig%5Bnocommon%5D=1"; |
|
149 | 149 | $xoops->tpl()->assign('uri_contami', $uri_contami); |
150 | 150 | |
151 | 151 | // Check isolated comments |
152 | -$uri_isocom = \XoopsBaseConfig::get('url') . "/index.php?cid=" . urlencode(",password /*"); |
|
152 | +$uri_isocom = \XoopsBaseConfig::get('url')."/index.php?cid=".urlencode(",password /*"); |
|
153 | 153 | $xoops->tpl()->assign('uri_isocom', $uri_isocom); |
154 | 154 | |
155 | 155 | $xoops->footer(); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | -require_once dirname(__DIR__) . '/class/gtickets.php'; |
|
24 | +require_once dirname(__DIR__).'/class/gtickets.php'; |
|
25 | 25 | |
26 | 26 | $xoops->db(); |
27 | 27 | global $xoopsDB; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $log_table = $db->prefix('protector_log'); |
36 | 36 | |
37 | 37 | // Protector object |
38 | -require_once dirname(__DIR__) . '/class/protector.php'; |
|
38 | +require_once dirname(__DIR__).'/class/protector.php'; |
|
39 | 39 | $protector = Protector::getInstance($db->conn); |
40 | 40 | $conf = $protector->getConf(); |
41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Ticket check |
49 | 49 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
50 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
50 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($_POST['action'] === 'update_ips') { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $fp = @fopen($protector->get_filepath4group1ips(), 'w'); |
71 | 71 | if ($fp) { |
72 | 72 | @flock($fp, LOCK_EX); |
73 | - fwrite($fp, serialize(array_unique($group1_ips)) . "\n"); |
|
73 | + fwrite($fp, serialize(array_unique($group1_ips))."\n"); |
|
74 | 74 | @flock($fp, LOCK_UN); |
75 | 75 | fclose($fp); |
76 | 76 | } else { |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $buf = array(); |
100 | 100 | $ids = array(); |
101 | 101 | while (false !== (list($lid, $ip, $type) = $db->fetchRow($result))) { |
102 | - if (isset($buf[$ip . $type])) { |
|
102 | + if (isset($buf[$ip.$type])) { |
|
103 | 103 | $ids[] = $lid; |
104 | 104 | } else { |
105 | - $buf[$ip . $type] = true; |
|
105 | + $buf[$ip.$type] = true; |
|
106 | 106 | } |
107 | 107 | } |
108 | - $db->query("DELETE FROM $log_table WHERE lid IN (" . implode(',', $ids) . ")"); |
|
108 | + $db->query("DELETE FROM $log_table WHERE lid IN (".implode(',', $ids).")"); |
|
109 | 109 | $xoops->redirect("center.php", 2, _AM_MSG_REMOVED); |
110 | 110 | } |
111 | 111 | } |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | uksort($bad_ips, 'protector_ip_cmp'); |
124 | 124 | $bad_ips4disp = ''; |
125 | 125 | foreach ($bad_ips as $bad_ip => $jailed_time) { |
126 | - $line = $jailed_time ? $bad_ip . ':' . $jailed_time : $bad_ip; |
|
126 | + $line = $jailed_time ? $bad_ip.':'.$jailed_time : $bad_ip; |
|
127 | 127 | $line = str_replace(':2147483647', '', $line); // remove :0x7fffffff |
128 | - $bad_ips4disp .= htmlspecialchars($line, ENT_QUOTES) . "\n"; |
|
128 | + $bad_ips4disp .= htmlspecialchars($line, ENT_QUOTES)."\n"; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // group1_ips |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // query for listing |
143 | 143 | $rs = $db->query("SELECT count(lid) FROM $log_table"); |
144 | 144 | list($numrows) = $db->fetchRow($rs); |
145 | -$prs = $db->query("SELECT l.lid, l.uid, l.ip, l.agent, l.type, l.description, UNIX_TIMESTAMP(l.timestamp), u.uname FROM $log_table l LEFT JOIN " . $db->prefix("system_user") . " u ON l.uid=u.uid ORDER BY timestamp DESC LIMIT $pos,$num"); |
|
145 | +$prs = $db->query("SELECT l.lid, l.uid, l.ip, l.agent, l.type, l.description, UNIX_TIMESTAMP(l.timestamp), u.uname FROM $log_table l LEFT JOIN ".$db->prefix("system_user")." u ON l.uid=u.uid ORDER BY timestamp DESC LIMIT $pos,$num"); |
|
146 | 146 | // Number selection |
147 | 147 | $num_options = ''; |
148 | 148 | $num_array = array(20, 100, 500, 2000); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // make agents shorter |
172 | 172 | if (preg_match('/MSIE\s+([0-9.]+)/', $agent, $regs)) { |
173 | - $agent_short = 'IE ' . $regs[1]; |
|
173 | + $agent_short = 'IE '.$regs[1]; |
|
174 | 174 | } else { |
175 | 175 | if (stristr($agent, 'Gecko') !== false) { |
176 | 176 | $agent_short = strrchr($agent, ' '); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | $agent4disp = htmlspecialchars($agent, ENT_QUOTES); |
182 | - $agent_desc = $agent == $agent_short ? $agent4disp : htmlspecialchars($agent_short, ENT_QUOTES) . "<img src='../images/dotdotdot.gif' alt='$agent4disp' title='$agent4disp' />"; |
|
182 | + $agent_desc = $agent == $agent_short ? $agent4disp : htmlspecialchars($agent_short, ENT_QUOTES)."<img src='../images/dotdotdot.gif' alt='$agent4disp' title='$agent4disp' />"; |
|
183 | 183 | |
184 | 184 | $log_arr['lid'] = $lid; |
185 | 185 | $log_arr['date'] = XoopsLocale::formatTimestamp($timestamp); |
@@ -19,6 +19,6 @@ |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
|
22 | +require_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | $modversion['name'] = _MI_PROTECTOR_NAME; |
27 | 27 | $modversion['description'] = constant('_MI_PROTECTOR_DESC'); |
28 | -$modversion['version'] = file_get_contents(__DIR__ . '/include/version.txt'); |
|
28 | +$modversion['version'] = file_get_contents(__DIR__.'/include/version.txt'); |
|
29 | 29 | $modversion['credits'] = "PEAK Corp."; |
30 | 30 | $modversion['author'] = "GIJ=CHECKMATE PEAK Corp.(http://www.peak.ne.jp/)"; |
31 | 31 | $modversion['help'] = 'page=help'; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | |
78 | 78 | // Admin Templates |
79 | 79 | $modversion['templates'] = array( |
80 | - array( 'file' => 'protector_advisory.tpl', 'description' => '', 'type' => 'admin' ), |
|
81 | - array( 'file' => 'protector_prefix.tpl', 'description' => '', 'type' => 'admin' ), |
|
82 | - array( 'file' => 'protector_center.tpl', 'description' => '', 'type' => 'admin' ), |
|
80 | + array('file' => 'protector_advisory.tpl', 'description' => '', 'type' => 'admin'), |
|
81 | + array('file' => 'protector_prefix.tpl', 'description' => '', 'type' => 'admin'), |
|
82 | + array('file' => 'protector_center.tpl', 'description' => '', 'type' => 'admin'), |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | /* |
@@ -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 | } |