@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | $subDirNameLength = 5; |
| 50 | 50 | |
| 51 | 51 | for ($i = 0; $i < $subDirCount; $i++) { |
| 52 | - $retval .= DIRECTORY_SEPARATOR . substr($fsHash, $i*$subDirNameLength, $subDirNameLength); |
|
| 52 | + $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i*$subDirNameLength, $subDirNameLength); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $retval .= DIRECTORY_SEPARATOR . substr($fsHash, $i*$subDirNameLength); |
|
| 55 | + $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i*$subDirNameLength); |
|
| 56 | 56 | |
| 57 | 57 | return $retval; |
| 58 | 58 | } |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | if ($headers) { |
| 195 | 195 | $disposition = 'attachment' == $disposition ? 'attachment' : 'inline'; |
| 196 | - header('Content-Type: ' . $this->mimeType, true); |
|
| 197 | - header('Content-Length: ' . $this->filesize, true); |
|
| 198 | - header("Content-Disposition: $disposition; filename=\"{$this->filename}\"" , true); |
|
| 196 | + header('Content-Type: '.$this->mimeType, true); |
|
| 197 | + header('Content-Length: '.$this->filesize, true); |
|
| 198 | + header("Content-Disposition: $disposition; filename=\"{$this->filename}\"", true); |
|
| 199 | 199 | header("Content-MD5: {$this->realHash}", true); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -364,7 +364,9 @@ |
||
| 364 | 364 | if (count($matches[1])) { |
| 365 | 365 | $languages = array_combine($matches[1], $matches[4]); |
| 366 | 366 | foreach ($languages as $lang => $val) { |
| 367 | - if ($val === '') $languages[$lang] = 1; |
|
| 367 | + if ($val === '') { |
|
| 368 | + $languages[$lang] = 1; |
|
| 369 | + } |
|
| 368 | 370 | } |
| 369 | 371 | arsort($languages, SORT_NUMERIC); |
| 370 | 372 | } |
@@ -132,33 +132,33 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // Get language from: _POST, _GET, _COOKIE, phpMyFAQ configuration and the automatic language detection |
| 134 | 134 | $_lang['post'] = PMF_Filter::filterInput(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
| 135 | - if (!is_null($_lang['post']) && !self::isASupportedLanguage($_lang['post']) ) { |
|
| 135 | + if (!is_null($_lang['post']) && !self::isASupportedLanguage($_lang['post'])) { |
|
| 136 | 136 | $_lang['post'] = null; |
| 137 | 137 | } |
| 138 | 138 | // Get the user language |
| 139 | 139 | $_lang['get'] = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING); |
| 140 | - if (!is_null($_lang['get']) && !self::isASupportedLanguage($_lang['get']) ) { |
|
| 140 | + if (!is_null($_lang['get']) && !self::isASupportedLanguage($_lang['get'])) { |
|
| 141 | 141 | $_lang['get'] = null; |
| 142 | 142 | } |
| 143 | 143 | // Get the faq record language |
| 144 | 144 | $_lang['artget'] = PMF_Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING); |
| 145 | - if (!is_null($_lang['artget']) && !self::isASupportedLanguage($_lang['artget']) ) { |
|
| 145 | + if (!is_null($_lang['artget']) && !self::isASupportedLanguage($_lang['artget'])) { |
|
| 146 | 146 | $_lang['artget'] = null; |
| 147 | 147 | } |
| 148 | 148 | // Get the language from the session |
| 149 | - if (isset($_SESSION['pmf_lang']) && self::isASupportedLanguage($_SESSION['pmf_lang']) ) { |
|
| 149 | + if (isset($_SESSION['pmf_lang']) && self::isASupportedLanguage($_SESSION['pmf_lang'])) { |
|
| 150 | 150 | $_lang['session'] = trim($_SESSION['pmf_lang']); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | // Get the language from the config |
| 154 | 154 | if (isset($configLanguage)) { |
| 155 | 155 | $confLangCode = str_replace(array("language_", ".php"), "", $configLanguage); |
| 156 | - if (self::isASupportedLanguage($confLangCode) ) { |
|
| 156 | + if (self::isASupportedLanguage($confLangCode)) { |
|
| 157 | 157 | $_lang['config'] = $confLangCode; |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | // Detect the browser's language |
| 161 | - if ((true === $configDetection) && self::isASupportedLanguage($this->acceptedLanguage) ) { |
|
| 161 | + if ((true === $configDetection) && self::isASupportedLanguage($this->acceptedLanguage)) { |
|
| 162 | 162 | $_lang['detection'] = strtolower($this->acceptedLanguage); |
| 163 | 163 | } |
| 164 | 164 | // Select the language |
@@ -206,12 +206,12 @@ discard block |
||
| 206 | 206 | { |
| 207 | 207 | global $languageCodes; |
| 208 | 208 | |
| 209 | - $search = array("language_" , ".php"); |
|
| 209 | + $search = array("language_", ".php"); |
|
| 210 | 210 | $languages = $languageFiles = []; |
| 211 | 211 | |
| 212 | 212 | $dir = new DirectoryIterator(PMF_LANGUAGE_DIR); |
| 213 | 213 | foreach ($dir as $fileinfo) { |
| 214 | - if (! $fileinfo->isDot()) { |
|
| 214 | + if (!$fileinfo->isDot()) { |
|
| 215 | 215 | $languageFiles[] = strtoupper( |
| 216 | 216 | str_replace($search, '', trim($fileinfo->getFilename())) |
| 217 | 217 | ); |
@@ -246,21 +246,21 @@ discard block |
||
| 246 | 246 | global $languageCodes; |
| 247 | 247 | |
| 248 | 248 | $onChange = ($submitOnChange ? ' onchange="this.form.submit();"' : ''); |
| 249 | - $output = '<select class="form-control" name="' . $id . '" id="' . $id . '" size="1"' . $onChange . ">\n"; |
|
| 249 | + $output = '<select class="form-control" name="'.$id.'" id="'.$id.'" size="1"'.$onChange.">\n"; |
|
| 250 | 250 | $languages = self::getAvailableLanguages(); |
| 251 | 251 | |
| 252 | 252 | if (count($languages) > 0) { |
| 253 | 253 | foreach ($languages as $lang => $value) { |
| 254 | - if (! in_array($lang, $excludedLanguages)) { |
|
| 255 | - $output .= "\t" . '<option value="' . $lang . '"'; |
|
| 254 | + if (!in_array($lang, $excludedLanguages)) { |
|
| 255 | + $output .= "\t".'<option value="'.$lang.'"'; |
|
| 256 | 256 | if ($lang == $default) { |
| 257 | 257 | $output .= ' selected="selected"'; |
| 258 | 258 | } |
| 259 | - $output .= '>' . $value . "</option>\n"; |
|
| 259 | + $output .= '>'.$value."</option>\n"; |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | } else { |
| 263 | - $output .= "\t<option value=\"en\">" . $languageCodes["EN"] . "</option>"; |
|
| 263 | + $output .= "\t<option value=\"en\">".$languageCodes["EN"]."</option>"; |
|
| 264 | 264 | } |
| 265 | 265 | $output .= "</select>\n"; |
| 266 | 266 | return $output; |
@@ -281,24 +281,24 @@ discard block |
||
| 281 | 281 | if ($onlyThisLang) { |
| 282 | 282 | if (strtolower($key) == $lang) { |
| 283 | 283 | if ($fileLanguageValue) { |
| 284 | - $output .= "\t<option value=\"language_" . strtolower($lang) . ".php\""; |
|
| 284 | + $output .= "\t<option value=\"language_".strtolower($lang).".php\""; |
|
| 285 | 285 | } else { |
| 286 | - $output .= "\t<option value=\"" . strtolower($lang) . "\""; |
|
| 286 | + $output .= "\t<option value=\"".strtolower($lang)."\""; |
|
| 287 | 287 | } |
| 288 | 288 | $output .= " selected=\"selected\""; |
| 289 | - $output .= ">" . $value . "</option>\n"; |
|
| 289 | + $output .= ">".$value."</option>\n"; |
|
| 290 | 290 | break; |
| 291 | 291 | } |
| 292 | 292 | } else { |
| 293 | 293 | if ($fileLanguageValue) { |
| 294 | - $output .= "\t<option value=\"language_" . strtolower($key) . ".php\""; |
|
| 294 | + $output .= "\t<option value=\"language_".strtolower($key).".php\""; |
|
| 295 | 295 | } else { |
| 296 | - $output .= "\t<option value=\"" . strtolower($key) . "\""; |
|
| 296 | + $output .= "\t<option value=\"".strtolower($key)."\""; |
|
| 297 | 297 | } |
| 298 | 298 | if (strtolower($key) == $lang) { |
| 299 | 299 | $output .= " selected=\"selected\""; |
| 300 | 300 | } |
| 301 | - $output .= ">" . $value . "</option>\n"; |
|
| 301 | + $output .= ">".$value."</option>\n"; |
|
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | return $output; |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | public static function isASupportedTinyMCELanguage($langcode) |
| 334 | 334 | { |
| 335 | 335 | return file_exists( |
| 336 | - PMF_ROOT_DIR . '/admin/editor/langs/' . $langcode . '.js' |
|
| 336 | + PMF_ROOT_DIR.'/admin/editor/langs/'.$langcode.'.js' |
|
| 337 | 337 | ); |
| 338 | 338 | } |
| 339 | 339 | |
@@ -43,6 +43,6 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function encrypt($str) |
| 45 | 45 | { |
| 46 | - return hash('sha256', $str . $this->salt); |
|
| 46 | + return hash('sha256', $str.$this->salt); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | * |
| 238 | 238 | * @return array|string |
| 239 | 239 | */ |
| 240 | - public function preg_replace_callback($pattern, $callback, $subject, $limit= -1, &$count = 0) |
|
| 240 | + public function preg_replace_callback($pattern, $callback, $subject, $limit = -1, &$count = 0) |
|
| 241 | 241 | { |
| 242 | - if(is_array($pattern)) { |
|
| 243 | - foreach($pattern as &$p) { |
|
| 242 | + if (is_array($pattern)) { |
|
| 243 | + foreach ($pattern as &$p) { |
|
| 244 | 244 | $p = self::appendU($p); |
| 245 | 245 | } |
| 246 | 246 | } else { |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @return array|string|null |
| 263 | 263 | */ |
| 264 | - public function preg_replace($pattern, $replacement, $subject, $limit= -1, &$count = 0) |
|
| 264 | + public function preg_replace($pattern, $replacement, $subject, $limit = -1, &$count = 0) |
|
| 265 | 265 | { |
| 266 | - if(is_array($pattern)) { |
|
| 267 | - foreach($pattern as &$p) { |
|
| 266 | + if (is_array($pattern)) { |
|
| 267 | + foreach ($pattern as &$p) { |
|
| 268 | 268 | $p = self::appendU($p); |
| 269 | 269 | } |
| 270 | 270 | } else { |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | private static function appendU($str) |
| 287 | 287 | { |
| 288 | - $str = (string) $str; |
|
| 288 | + $str = (string)$str; |
|
| 289 | 289 | |
| 290 | - return parent::isUTF8($str) ? $str . 'u' : $str; |
|
| 290 | + return parent::isUTF8($str) ? $str.'u' : $str; |
|
| 291 | 291 | } |
| 292 | 292 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function strstr($haystack, $needle, $part = false) |
| 162 | 162 | { |
| 163 | - return strstr($haystack, $needle, (boolean) $part); |
|
| 163 | + return strstr($haystack, $needle, (boolean)$part); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * |
| 263 | 263 | * @return array|string |
| 264 | 264 | */ |
| 265 | - public function preg_replace_callback($pattern, $callback, $subject, $limit= -1, &$count = 0) |
|
| 265 | + public function preg_replace_callback($pattern, $callback, $subject, $limit = -1, &$count = 0) |
|
| 266 | 266 | { |
| 267 | 267 | return preg_replace_callback($pattern, $callback, $subject, $limit, $count); |
| 268 | 268 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * @return array|string|null |
| 280 | 280 | */ |
| 281 | - public function preg_replace($pattern, $replacement, $subject, $limit= -1, &$count = 0) |
|
| 281 | + public function preg_replace($pattern, $replacement, $subject, $limit = -1, &$count = 0) |
|
| 282 | 282 | { |
| 283 | 283 | return preg_replace($pattern, $replacement, $subject, $limit, $count); |
| 284 | 284 | } |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | * |
| 299 | 299 | * @return array|string |
| 300 | 300 | */ |
| 301 | - public function preg_replace_callback($pattern, $callback, $subject, $limit= -1, &$count = 0) |
|
| 301 | + public function preg_replace_callback($pattern, $callback, $subject, $limit = -1, &$count = 0) |
|
| 302 | 302 | { |
| 303 | 303 | if (is_array($pattern)) { |
| 304 | - foreach($pattern as &$p) { |
|
| 304 | + foreach ($pattern as &$p) { |
|
| 305 | 305 | $p = self::appendU($p); |
| 306 | 306 | } |
| 307 | 307 | } else { |
@@ -322,10 +322,10 @@ discard block |
||
| 322 | 322 | * |
| 323 | 323 | * @return array|string|null |
| 324 | 324 | */ |
| 325 | - public function preg_replace($pattern, $replacement, $subject, $limit= -1, &$count = 0) |
|
| 325 | + public function preg_replace($pattern, $replacement, $subject, $limit = -1, &$count = 0) |
|
| 326 | 326 | { |
| 327 | 327 | if (is_array($pattern)) { |
| 328 | - foreach($pattern as &$p) { |
|
| 328 | + foreach ($pattern as &$p) { |
|
| 329 | 329 | $p = self::appendU($p); |
| 330 | 330 | } |
| 331 | 331 | } else { |
@@ -346,6 +346,6 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | private static function appendU($str) |
| 348 | 348 | { |
| 349 | - return ((string) $str) . 'u'; |
|
| 349 | + return ((string)$str).'u'; |
|
| 350 | 350 | } |
| 351 | 351 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | * |
| 64 | 64 | * @param string $language |
| 65 | 65 | * |
| 66 | - * @return PMF_String_Basic |
|
| 66 | + * @return PMF_String_UTF8ToLatinConvertable |
|
| 67 | 67 | */ |
| 68 | 68 | public static function getInstance($language = 'en') |
| 69 | 69 | { |
@@ -37,7 +37,6 @@ |
||
| 37 | 37 | * @author Anatoliy Belsky <[email protected]> |
| 38 | 38 | * @copyright 2009-2014 phpMyFAQ Team |
| 39 | 39 | * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 40 | - |
|
| 41 | 40 | * @link http://www.phpmyfaq.de |
| 42 | 41 | * @since 2009-04-06 |
| 43 | 42 | */ |
@@ -329,8 +329,7 @@ |
||
| 329 | 329 | if ($nextline < 1) { |
| 330 | 330 | $nextline = 2; |
| 331 | 331 | } |
| 332 | - } |
|
| 333 | - else { |
|
| 332 | + } else { |
|
| 334 | 333 | $nextline += rand(1, 7); |
| 335 | 334 | } |
| 336 | 335 | $w1 += rand(-4, 4); |
@@ -466,10 +466,10 @@ discard block |
||
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
| 469 | - * Save the Captcha |
|
| 470 | - * |
|
| 471 | - * @return boolean |
|
| 472 | - */ |
|
| 469 | + * Save the Captcha |
|
| 470 | + * |
|
| 471 | + * @return boolean |
|
| 472 | + */ |
|
| 473 | 473 | private function saveCaptcha() |
| 474 | 474 | { |
| 475 | 475 | $select = sprintf(" |
@@ -479,8 +479,8 @@ discard block |
||
| 479 | 479 | %sfaqcaptcha |
| 480 | 480 | WHERE |
| 481 | 481 | id = '%s'", |
| 482 | - PMF_Db::getTablePrefix(), |
|
| 483 | - $this->code |
|
| 482 | + PMF_Db::getTablePrefix(), |
|
| 483 | + $this->code |
|
| 484 | 484 | ); |
| 485 | 485 | |
| 486 | 486 | $result = $this->_config->getDb()->query($select); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | if (function_exists('imagejpeg')) { |
| 219 | 219 | $response->headers->set('Content-Type', 'image/jpeg'); |
| 220 | - $quality = (int) $this->quality; |
|
| 220 | + $quality = (int)$this->quality; |
|
| 221 | 221 | $response->setCallback(function() use ($img, $quality) { |
| 222 | 222 | imagejpeg($img, null, $quality); |
| 223 | 223 | }); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $captchaCode = str_replace("0", "O", $captchaCode); |
| 269 | 269 | } |
| 270 | 270 | // Sanity check |
| 271 | - for ($i = 0; $i < PMF_String::strlen( $captchaCode ); $i++) { |
|
| 271 | + for ($i = 0; $i < PMF_String::strlen($captchaCode); $i++) { |
|
| 272 | 272 | if (!in_array($captchaCode[$i], $this->letters)) { |
| 273 | 273 | return false; |
| 274 | 274 | } |
@@ -362,16 +362,16 @@ discard block |
||
| 362 | 362 | { |
| 363 | 363 | $len = PMF_String::strlen($this->code); |
| 364 | 364 | $w1 = 15; |
| 365 | - $w2 = $this->width / ($len + 1); |
|
| 365 | + $w2 = $this->width/($len + 1); |
|
| 366 | 366 | |
| 367 | 367 | for ($p = 0; $p < $len; $p++) { |
| 368 | 368 | $letter = $this->code[$p]; |
| 369 | 369 | if (count($this->fonts) > 0) { |
| 370 | 370 | $font = $this->fonts[rand(0, count($this->fonts) - 1)]; |
| 371 | 371 | } |
| 372 | - $size = rand(20, $this->height / 2.2); |
|
| 372 | + $size = rand(20, $this->height/2.2); |
|
| 373 | 373 | $rotation = rand(-23, 23); |
| 374 | - $y = rand($size + 3, $this->height-5); |
|
| 374 | + $y = rand($size + 3, $this->height - 5); |
|
| 375 | 375 | // $w1 += rand(- $this->width / 90, $this->width / 40 ); |
| 376 | 376 | $x = $w1 + $w2*$p; |
| 377 | 377 | $c1 = []; // fore char color |
@@ -387,28 +387,28 @@ discard block |
||
| 387 | 387 | } while ($c1['b'] == $this->_backgroundColor['b']); |
| 388 | 388 | $c1 = imagecolorallocate($this->img, $c1['r'], $c1['g'], $c1['b']); |
| 389 | 389 | do { |
| 390 | - $c2['r'] = ($c1['r'] < 100 ? $c1['r'] * 2 : mt_rand(30, 199)); |
|
| 390 | + $c2['r'] = ($c1['r'] < 100 ? $c1['r']*2 : mt_rand(30, 199)); |
|
| 391 | 391 | } while (($c2['r'] == $this->_backgroundColor['r']) && ($c2['r'] == $c1['r'])); |
| 392 | 392 | do { |
| 393 | - $c2['g'] = ($c1['g'] < 100 ? $c1['g'] * 2 : mt_rand(30, 199)); |
|
| 393 | + $c2['g'] = ($c1['g'] < 100 ? $c1['g']*2 : mt_rand(30, 199)); |
|
| 394 | 394 | } while (($c2['g'] == $this->_backgroundColor['g']) && ($c2['g'] == $c1['g'])); |
| 395 | 395 | do { |
| 396 | - $c2['b'] = ($c1['b'] < 100 ? $c1['b'] * 2 : mt_rand(30, 199)); |
|
| 396 | + $c2['b'] = ($c1['b'] < 100 ? $c1['b']*2 : mt_rand(30, 199)); |
|
| 397 | 397 | } while (($c2['b'] == $this->_backgroundColor['b']) && ($c2['b'] == $c1['b'])); |
| 398 | 398 | $c2 = imagecolorallocate($this->img, $c2['r'], $c2['g'], $c2['b']); |
| 399 | 399 | // Add the letter |
| 400 | 400 | if (function_exists('imagettftext') && (count($this->fonts) > 0)) { |
| 401 | - imagettftext($this->img, $size, $rotation, $x + 2, $y, $c2, $font, $letter); |
|
| 401 | + imagettftext($this->img, $size, $rotation, $x + 2, $y, $c2, $font, $letter); |
|
| 402 | 402 | imagettftext($this->img, $size, $rotation, $x + 1, $y + 1, $c2, $font, $letter); |
| 403 | - imagettftext($this->img, $size, $rotation, $x, $y-2, $c1, $font, $letter); |
|
| 403 | + imagettftext($this->img, $size, $rotation, $x, $y - 2, $c1, $font, $letter); |
|
| 404 | 404 | } else { |
| 405 | 405 | $size = 5; |
| 406 | 406 | $c3 = imagecolorallocate($this->img, 0, 0, 255); |
| 407 | 407 | $x = 20; |
| 408 | 408 | $y = 12; |
| 409 | 409 | $s = 30; |
| 410 | - imagestring($this->img, $size, $x + 1 + ($s * $p), $y+1, $letter, $c3); |
|
| 411 | - imagestring($this->img, $size, $x + ($s * $p), $y, $letter, $c1); |
|
| 410 | + imagestring($this->img, $size, $x + 1 + ($s*$p), $y + 1, $letter, $c3); |
|
| 411 | + imagestring($this->img, $size, $x + ($s*$p), $y, $letter, $c1); |
|
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | // Create the captcha code |
| 470 | 470 | for ($i = 1; $i <= $caplength; $i++) { |
| 471 | - $j = floor(rand(0,34)); |
|
| 471 | + $j = floor(rand(0, 34)); |
|
| 472 | 472 | $this->code .= $this->letters[$j]; |
| 473 | 473 | } |
| 474 | 474 | if (!$this->saveCaptcha()) { |
@@ -571,6 +571,6 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | private function getFonts() |
| 573 | 573 | { |
| 574 | - return glob(PMF_INCLUDE_DIR . '/fonts/*.ttf'); |
|
| 574 | + return glob(PMF_INCLUDE_DIR.'/fonts/*.ttf'); |
|
| 575 | 575 | } |
| 576 | 576 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | if (empty($this->joinedTable)) { |
| 163 | 163 | return ''; |
| 164 | 164 | } else { |
| 165 | - return ' LEFT JOIN ' . $this->joinedTable . ' ON '; |
|
| 165 | + return ' LEFT JOIN '.$this->joinedTable.' ON '; |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if (empty($resultColumns)) { |
| 194 | 194 | $resultColumns = $column; |
| 195 | 195 | } else { |
| 196 | - $resultColumns .= ', ' . $column; |
|
| 196 | + $resultColumns .= ', '.$column; |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $joinedColumns = ''; |
| 225 | 225 | |
| 226 | 226 | foreach ($this->joinedColumns as $column) { |
| 227 | - $joinedColumns .= $column . ' AND '; |
|
| 227 | + $joinedColumns .= $column.' AND '; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return PMF_String::substr($joinedColumns, 0, -4); |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | if (count($this->conditions)) { |
| 281 | 281 | foreach ($this->conditions as $column => $value) { |
| 282 | 282 | if (is_array($value)) { |
| 283 | - $conditions .= ' AND ' . $column . ' IN (' . implode(', ', $value) . ')'; |
|
| 283 | + $conditions .= ' AND '.$column.' IN ('.implode(', ', $value).')'; |
|
| 284 | 284 | } else { |
| 285 | - $conditions .= ' AND ' . $column . ' = ' . $value; |
|
| 285 | + $conditions .= ' AND '.$column.' = '.$value; |
|
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | $where = ''; |
| 306 | 306 | |
| 307 | 307 | for ($i = 0; $i < $numKeys; $i++) { |
| 308 | - if (strlen($where) != 0 ) { |
|
| 309 | - $where = $where . " OR"; |
|
| 308 | + if (strlen($where) != 0) { |
|
| 309 | + $where = $where." OR"; |
|
| 310 | 310 | } |
| 311 | - $where = $where . " ("; |
|
| 311 | + $where = $where." ("; |
|
| 312 | 312 | for ($j = 0; $j < $numMatch; $j++) { |
| 313 | 313 | if ($j != 0) { |
| 314 | 314 | $where = $where." OR "; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | return sprintf( |
| 115 | 115 | '<a class="searchplugin" href="#" onclick="window.external.AddSearchProvider(\'%s\'); return false;">%s</a>', |
| 116 | - $this->_config->get('main.referenceURL') . '/opensearch.php', |
|
| 116 | + $this->_config->get('main.referenceURL').'/opensearch.php', |
|
| 117 | 117 | $this->translation['opensearch_plugin_install'] |
| 118 | 118 | ); |
| 119 | 119 | } |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | $confPerPage = $this->_config->get('records.numberOfRecordsPerPage'); |
| 241 | 241 | $numOfResults = $resultSet->getNumberOfResults(); |
| 242 | 242 | |
| 243 | - $totalPages = ceil($numOfResults / $confPerPage); |
|
| 244 | - $lastPage = $currentPage * $confPerPage; |
|
| 243 | + $totalPages = ceil($numOfResults/$confPerPage); |
|
| 244 | + $lastPage = $currentPage*$confPerPage; |
|
| 245 | 245 | $firstPage = $lastPage - $confPerPage; |
| 246 | 246 | if ($lastPage > $numOfResults) { |
| 247 | 247 | $lastPage = $numOfResults; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $this->translation['msgPage'], |
| 261 | 261 | $currentPage, |
| 262 | 262 | $this->translation['msgVoteFrom'], |
| 263 | - $this->plurals->GetMsg('plmsgPagesTotal',$totalPages) |
|
| 263 | + $this->plurals->GetMsg('plmsgPagesTotal', $totalPages) |
|
| 264 | 264 | ); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $oLink->itemTitle = $result->question; |
| 377 | 377 | $oLink->text = $result->question; |
| 378 | 378 | $oLink->tooltip = $result->question; |
| 379 | - $html .= '<li>' . $oLink->toHtmlAnchor() . '</li>'; |
|
| 379 | + $html .= '<li>'.$oLink->toHtmlAnchor().'</li>'; |
|
| 380 | 380 | } |
| 381 | 381 | $html .= '</ul>'; |
| 382 | 382 | } |
@@ -406,6 +406,6 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - return $html . '</ul>'; |
|
| 409 | + return $html.'</ul>'; |
|
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | \ No newline at end of file |
@@ -293,10 +293,10 @@ |
||
| 293 | 293 | |
| 294 | 294 | if ($this->_config->get('search.enableHighlighting') && PMF_String::strlen($searchItems[0]) > 1) { |
| 295 | 295 | foreach ($searchItems as $item) { |
| 296 | - if (PMF_String::strlen($item) > 2) { |
|
| 297 | - $question = PMF_Utils::setHighlightedString($question, $item); |
|
| 298 | - $answerPreview = PMF_Utils::setHighlightedString($answerPreview, $item); |
|
| 299 | - } |
|
| 296 | + if (PMF_String::strlen($item) > 2) { |
|
| 297 | + $question = PMF_Utils::setHighlightedString($question, $item); |
|
| 298 | + $answerPreview = PMF_Utils::setHighlightedString($answerPreview, $item); |
|
| 299 | + } |
|
| 300 | 300 | } |
| 301 | 301 | } |
| 302 | 302 | |