@@ -139,7 +139,7 @@ |
||
| 139 | 139 | public function error() |
| 140 | 140 | { |
| 141 | 141 | if (!is_array($this->errors)) { |
| 142 | - $this->errors = array((string) $this->errors); |
|
| 142 | + $this->errors = array((string)$this->errors); |
|
| 143 | 143 | } |
| 144 | 144 | $message = ''; |
| 145 | 145 | foreach ($this->errors as $error) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | /* |
| 184 | 184 | * reduction factor for small font |
| 185 | 185 | */ |
| 186 | -define('K_SMALL_RATIO', 2 / 3); |
|
| 186 | +define('K_SMALL_RATIO', 2/3); |
|
| 187 | 187 | |
| 188 | 188 | require K_PATH_MAIN.'/tcpdf.php'; |
| 189 | 189 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Set font |
| 309 | 309 | if (array_key_exists($PMF_LANG['metaLanguage'], $this->fontFiles)) { |
| 310 | - $this->currentFont = (string) $this->fontFiles[$PMF_LANG['metaLanguage']]; |
|
| 310 | + $this->currentFont = (string)$this->fontFiles[$PMF_LANG['metaLanguage']]; |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -82,13 +82,13 @@ |
||
| 82 | 82 | $faqdata = $this->faq->get(FAQ_QUERY_TYPE_EXPORT_XHTML, $categoryId, $downwards, $language); |
| 83 | 83 | $version = $this->_config->get('main.currentVersion'); |
| 84 | 84 | $comment = sprintf('XHTML output by phpMyFAQ %s | Date: %s', |
| 85 | - $version, |
|
| 86 | - PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 85 | + $version, |
|
| 86 | + PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 87 | 87 | |
| 88 | 88 | $this->xml->startDocument('1.0', 'utf-8'); |
| 89 | 89 | $this->xml->writeDtd('html', |
| 90 | - '-//W3C//DTD XHTML 1.0 Transitional//EN', |
|
| 91 | - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'); |
|
| 90 | + '-//W3C//DTD XHTML 1.0 Transitional//EN', |
|
| 91 | + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'); |
|
| 92 | 92 | $this->xml->startElement('html'); |
| 93 | 93 | $this->xml->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); |
| 94 | 94 | $this->xml->writeAttribute('xml:lang', $language); |
@@ -80,8 +80,8 @@ |
||
| 80 | 80 | $faqdata = $this->faq->get(FAQ_QUERY_TYPE_EXPORT_XML, $categoryId, $downwards, $language); |
| 81 | 81 | $version = $this->_config->get('main.currentVersion'); |
| 82 | 82 | $comment = sprintf('XML output by phpMyFAQ %s | Date: %s', |
| 83 | - $version, |
|
| 84 | - PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 83 | + $version, |
|
| 84 | + PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 85 | 85 | |
| 86 | 86 | $this->xml->startDocument('1.0', 'utf-8', 'yes'); |
| 87 | 87 | $this->xml->writeComment($comment); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | WHERE |
| 217 | 217 | id = %d AND lang = '%s'", |
| 218 | 218 | PMF_Db::getTablePrefix(), |
| 219 | - (int) $id, |
|
| 219 | + (int)$id, |
|
| 220 | 220 | $this->config->getLanguage()->getLanguage() |
| 221 | 221 | ); |
| 222 | 222 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | PMF_Db::getTablePrefix(), |
| 292 | 292 | PMF_String::htmlspecialchars($this->item), |
| 293 | 293 | PMF_String::htmlspecialchars($this->definition), |
| 294 | - (int) $id, |
|
| 294 | + (int)$id, |
|
| 295 | 295 | $this->config->getLanguage()->getLanguage() |
| 296 | 296 | ); |
| 297 | 297 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | WHERE |
| 318 | 318 | id = %d AND lang = '%s'", |
| 319 | 319 | PMF_Db::getTablePrefix(), |
| 320 | - (int) $id, |
|
| 320 | + (int)$id, |
|
| 321 | 321 | $this->config->getLanguage()->getLanguage() |
| 322 | 322 | ); |
| 323 | 323 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $numFaqs = $this->Category->getNumberOfRecordsOfCategory(); |
| 54 | 54 | |
| 55 | 55 | if ($numCategories > 0) { |
| 56 | - for ($y = 0;$y < $numCategories; $y = $this->Category->getNextLineTree($y)) { |
|
| 56 | + for ($y = 0; $y < $numCategories; $y = $this->Category->getNextLineTree($y)) { |
|
| 57 | 57 | list($hasChild, $name, $categoryId, $description, $active) = $this->Category->getLineDisplay($y); |
| 58 | 58 | |
| 59 | 59 | if (!$active) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $this->Category->expandAll(); |
| 159 | 159 | |
| 160 | 160 | if ($numCategories > 0) { |
| 161 | - for ($y = 0;$y < $this->Category->height(); $y = $this->Category->getNextLineTree($y)) { |
|
| 161 | + for ($y = 0; $y < $this->Category->height(); $y = $this->Category->getNextLineTree($y)) { |
|
| 162 | 162 | list($hasChild, $categoryName, $parent, $description, $active) = $this->Category->getLineDisplay($y); |
| 163 | 163 | |
| 164 | 164 | if (!$active) { |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | { |
| 254 | 254 | $categories = ''; |
| 255 | 255 | foreach ($this->Category->categories as $cat) { |
| 256 | - if (0 === (int) $cat['parent_id']) { |
|
| 256 | + if (0 === (int)$cat['parent_id']) { |
|
| 257 | 257 | $categories .= sprintf( |
| 258 | 258 | '<li><a href="?action=show&cat=%d">%s</a></li>', |
| 259 | 259 | $cat['id'], |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Linkverifier Helper class for phpMyFAQ. |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.5 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @copyright 2012-2015 phpMyFAQ Team |
|
| 15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | - * |
|
| 17 | - * @link http://www.phpmyfaq.de |
|
| 18 | - * @since 2012-09-03 |
|
| 19 | - */ |
|
| 3 | + * Linkverifier Helper class for phpMyFAQ. |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.5 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @copyright 2012-2015 phpMyFAQ Team |
|
| 15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | + * |
|
| 17 | + * @link http://www.phpmyfaq.de |
|
| 18 | + * @since 2012-09-03 |
|
| 19 | + */ |
|
| 20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 21 | 21 | exit(); |
| 22 | 22 | } |
@@ -212,8 +212,8 @@ |
||
| 212 | 212 | $confPerPage = $this->_config->get('records.numberOfRecordsPerPage'); |
| 213 | 213 | $numOfResults = $resultSet->getNumberOfResults(); |
| 214 | 214 | |
| 215 | - $totalPages = ceil($numOfResults / $confPerPage); |
|
| 216 | - $lastPage = $currentPage * $confPerPage; |
|
| 215 | + $totalPages = ceil($numOfResults/$confPerPage); |
|
| 216 | + $lastPage = $currentPage*$confPerPage; |
|
| 217 | 217 | $firstPage = $lastPage - $confPerPage; |
| 218 | 218 | if ($lastPage > $numOfResults) { |
| 219 | 219 | $lastPage = $numOfResults; |
@@ -138,16 +138,16 @@ discard block |
||
| 138 | 138 | return $filename; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - /** |
|
| 142 | - * Clean the filename of any uploaded file by the user and force an error |
|
| 143 | - * when calling is_uploaded_file($_FILES[key]['tmp_name']) if the cleanup goes wrong. |
|
| 144 | - */ |
|
| 145 | - private static function _cleanFilenames() |
|
| 146 | - { |
|
| 147 | - reset($_FILES); |
|
| 148 | - while (list($key, $value) = each($_FILES)) { |
|
| 149 | - if (is_array($_FILES[$key]['name'])) { |
|
| 150 | - reset($_FILES[$key]['name']); |
|
| 141 | + /** |
|
| 142 | + * Clean the filename of any uploaded file by the user and force an error |
|
| 143 | + * when calling is_uploaded_file($_FILES[key]['tmp_name']) if the cleanup goes wrong. |
|
| 144 | + */ |
|
| 145 | + private static function _cleanFilenames() |
|
| 146 | + { |
|
| 147 | + reset($_FILES); |
|
| 148 | + while (list($key, $value) = each($_FILES)) { |
|
| 149 | + if (is_array($_FILES[$key]['name'])) { |
|
| 150 | + reset($_FILES[$key]['name']); |
|
| 151 | 151 | // We have a multiple upload with the same name for <input /> |
| 152 | 152 | while (list($idx, $value2) = each($_FILES[$key]['name'])) { |
| 153 | 153 | $_FILES[$key]['name'][$idx] = self::_basicFilenameClean($_FILES[$key]['name'][$idx]); |
@@ -158,19 +158,19 @@ discard block |
||
| 158 | 158 | $_FILES[$key]['error'][$idx] = UPLOAD_ERR_NO_FILE; |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | - reset($_FILES[$key]['name']); |
|
| 162 | - } else { |
|
| 163 | - $_FILES[$key]['name'] = self::_basicFilenameClean($_FILES[$key]['name']); |
|
| 164 | - if ('' == $_FILES[$key]['name']) { |
|
| 165 | - $_FILES[$key]['type'] = ''; |
|
| 166 | - $_FILES[$key]['tmp_name'] = ''; |
|
| 167 | - $_FILES[$key]['size'] = 0; |
|
| 168 | - $_FILES[$key]['error'] = UPLOAD_ERR_NO_FILE; |
|
| 169 | - } |
|
| 170 | - } |
|
| 171 | - } |
|
| 172 | - reset($_FILES); |
|
| 173 | - } |
|
| 161 | + reset($_FILES[$key]['name']); |
|
| 162 | + } else { |
|
| 163 | + $_FILES[$key]['name'] = self::_basicFilenameClean($_FILES[$key]['name']); |
|
| 164 | + if ('' == $_FILES[$key]['name']) { |
|
| 165 | + $_FILES[$key]['type'] = ''; |
|
| 166 | + $_FILES[$key]['tmp_name'] = ''; |
|
| 167 | + $_FILES[$key]['size'] = 0; |
|
| 168 | + $_FILES[$key]['error'] = UPLOAD_ERR_NO_FILE; |
|
| 169 | + } |
|
| 170 | + } |
|
| 171 | + } |
|
| 172 | + reset($_FILES); |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | 176 | * Cleans a html string from some xss issues. |