@@ -153,8 +153,8 @@ |
||
153 | 153 | $bytes_addr = unpack('n*', inet_pton($addr)); |
154 | 154 | $bytes_test = unpack('n*', inet_pton($ip)); |
155 | 155 | |
156 | - for ($i = 1; $i <= ceil($preflen / 16); ++$i) { |
|
157 | - $left = $preflen - 16 * ($i - 1); |
|
156 | + for ($i = 1; $i <= ceil($preflen/16); ++$i) { |
|
157 | + $left = $preflen - 16*($i - 1); |
|
158 | 158 | if ($left > 16) { |
159 | 159 | $left = 16; |
160 | 160 | } |
@@ -150,9 +150,9 @@ |
||
150 | 150 | |
151 | 151 | foreach ($news as $item) { |
152 | 152 | $url = sprintf('%s?action=news&newsid=%d&newslang=%s', |
153 | - PMF_Link::getSystemRelativeUri(), |
|
154 | - $item['id'], |
|
155 | - $item['lang']); |
|
153 | + PMF_Link::getSystemRelativeUri(), |
|
154 | + $item['id'], |
|
155 | + $item['lang']); |
|
156 | 156 | $oLink = new PMF_Link($url, $this->_config); |
157 | 157 | |
158 | 158 | if (isset($item['header'])) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if ($this->_config->get('records.numberOfShownNewsEntries') > 0 && $this->_config->getDb()->numRows($result) > 0) { |
107 | 107 | while (($row = $this->_config->getDb()->fetchObject($result))) { |
108 | 108 | ++$counter; |
109 | - if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
109 | + if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
110 | 110 | ((!$showArchive) && (!$forceConfLimit) && |
111 | 111 | ($counter <= $this->_config->get('records.numberOfShownNewsEntries'))) || |
112 | 112 | ((!$showArchive) && $forceConfLimit)) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | 'allowComments' => ('y' == $row->comment), |
126 | 126 | 'link' => $row->link, |
127 | 127 | 'linkTitle' => $row->linktitel, |
128 | - 'target' => $row->target, ); |
|
128 | + 'target' => $row->target,); |
|
129 | 129 | $news[] = $item; |
130 | 130 | } |
131 | 131 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | 'allowComments' => $allowComments, |
287 | 287 | 'link' => $row->link, |
288 | 288 | 'linkTitle' => $row->linktitel, |
289 | - 'target' => $row->target, ); |
|
289 | + 'target' => $row->target,); |
|
290 | 290 | } |
291 | 291 | } |
292 | 292 |
@@ -277,8 +277,8 @@ |
||
277 | 277 | public function render() |
278 | 278 | { |
279 | 279 | $content = []; |
280 | - $pages = ceil($this->total / $this->perPage); |
|
281 | - $adjacents = floor($this->adjacents / 2) >= 1 ? floor($this->adjacents / 2) : 1; |
|
280 | + $pages = ceil($this->total/$this->perPage); |
|
281 | + $adjacents = floor($this->adjacents/2) >= 1 ? floor($this->adjacents/2) : 1; |
|
282 | 282 | |
283 | 283 | for ($page = 1; $page <= $pages; ++$page) { |
284 | 284 | if ($page > $this->adjacents && $page < $this->currentPage - $adjacents) { |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | |
268 | 268 | // process right data |
269 | 269 | $right_data = $this->config->getDb()->fetchArray($res); |
270 | - $right_data['for_users'] = (bool) $right_data['for_users']; |
|
271 | - $right_data['for_groups'] = (bool) $right_data['for_groups']; |
|
270 | + $right_data['for_users'] = (bool)$right_data['for_users']; |
|
271 | + $right_data['for_groups'] = (bool)$right_data['for_groups']; |
|
272 | 272 | |
273 | 273 | return $right_data; |
274 | 274 | } |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | $nextId, |
328 | 328 | $rightData['name'], |
329 | 329 | $rightData['description'], |
330 | - isset($rightData['for_users']) ? (int) $rightData['for_users'] : 1, |
|
331 | - isset($rightData['for_groups']) ? (int) $rightData['for_groups'] : 1 |
|
330 | + isset($rightData['for_users']) ? (int)$rightData['for_users'] : 1, |
|
331 | + isset($rightData['for_groups']) ? (int)$rightData['for_groups'] : 1 |
|
332 | 332 | ); |
333 | 333 | |
334 | 334 | if (!$this->config->getDb()->query($insert)) { |
@@ -552,8 +552,8 @@ discard block |
||
552 | 552 | $right_data['for_groups'] = $this->default_right_data['for_groups']; |
553 | 553 | } |
554 | 554 | |
555 | - $right_data['for_users'] = (int) $right_data['for_users']; |
|
556 | - $right_data['for_groups'] = (int) $right_data['for_groups']; |
|
555 | + $right_data['for_users'] = (int)$right_data['for_users']; |
|
556 | + $right_data['for_groups'] = (int)$right_data['for_groups']; |
|
557 | 557 | |
558 | 558 | return $right_data; |
559 | 559 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $nextId, |
277 | 277 | $groupData['name'], |
278 | 278 | $groupData['description'], |
279 | - (int) $groupData['auto_join'] |
|
279 | + (int)$groupData['auto_join'] |
|
280 | 280 | ); |
281 | 281 | |
282 | 282 | $res = $this->config->getDb()->query($insert); |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | if (!isset($groupData['auto_join'])) { |
769 | 769 | $groupData['auto_join'] = $this->defaultGroupData['auto_join']; |
770 | 770 | } |
771 | - $groupData['auto_join'] = (int) $groupData['auto_join']; |
|
771 | + $groupData['auto_join'] = (int)$groupData['auto_join']; |
|
772 | 772 | |
773 | 773 | return $groupData; |
774 | 774 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | break; |
126 | 126 | |
127 | - default: |
|
127 | + default: |
|
128 | 128 | $query = sprintf(' |
129 | 129 | SELECT |
130 | 130 | fd.id AS id, |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | $result = $this->_config->getDb()->query($query); |
165 | 165 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
166 | 166 | $ratings[] = array( |
167 | - 'id' => $row->id, |
|
168 | - 'lang' => $row->lang, |
|
169 | - 'category_id' => $row->category_id, |
|
170 | - 'question' => $row->question, |
|
171 | - 'num' => $row->num, |
|
172 | - 'usr' => $row->usr, |
|
167 | + 'id' => $row->id, |
|
168 | + 'lang' => $row->lang, |
|
169 | + 'category_id' => $row->category_id, |
|
170 | + 'question' => $row->question, |
|
171 | + 'num' => $row->num, |
|
172 | + 'usr' => $row->usr, |
|
173 | 173 | ); |
174 | 174 | } |
175 | 175 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | foreach ($botBlacklist as $bot) { |
90 | - if ((bool) PMF_String::strstr($agent, $bot)) { |
|
90 | + if ((bool)PMF_String::strstr($agent, $bot)) { |
|
91 | 91 | ++$bots; |
92 | 92 | } |
93 | 93 | } |
@@ -77,14 +77,14 @@ |
||
77 | 77 | return mb_detect_encoding($str, 'UTF-8', true); |
78 | 78 | } else { |
79 | 79 | $regex = '/^([\x00-\x7f]|' |
80 | - .'[\xc2-\xdf][\x80-\xbf]|' |
|
81 | - .'\xe0[\xa0-\xbf][\x80-\xbf]|' |
|
82 | - .'[\xe1-\xec][\x80-\xbf]{2}|' |
|
83 | - .'\xed[\x80-\x9f][\x80-\xbf]|' |
|
84 | - .'[\xee-\xef][\x80-\xbf]{2}|' |
|
85 | - .'\xf0[\x90-\xbf][\x80-\xbf]{2}|' |
|
86 | - .'[\xf1-\xf3][\x80-\xbf]{3}|' |
|
87 | - .'\xf4[\x80-\x8f][\x80-\xbf]{2})*$/'; |
|
80 | + .'[\xc2-\xdf][\x80-\xbf]|' |
|
81 | + .'\xe0[\xa0-\xbf][\x80-\xbf]|' |
|
82 | + .'[\xe1-\xec][\x80-\xbf]{2}|' |
|
83 | + .'\xed[\x80-\x9f][\x80-\xbf]|' |
|
84 | + .'[\xee-\xef][\x80-\xbf]{2}|' |
|
85 | + .'\xf0[\x90-\xbf][\x80-\xbf]{2}|' |
|
86 | + .'[\xf1-\xf3][\x80-\xbf]{3}|' |
|
87 | + .'\xf4[\x80-\x8f][\x80-\xbf]{2})*$/'; |
|
88 | 88 | |
89 | 89 | return preg_match($regex, $str) === 1; |
90 | 90 | } |
@@ -155,7 +155,7 @@ |
||
155 | 155 | */ |
156 | 156 | public function strstr($haystack, $needle, $part = false) |
157 | 157 | { |
158 | - return strstr($haystack, $needle, (boolean) $part); |
|
158 | + return strstr($haystack, $needle, (boolean)$part); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |