@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param string |
| 69 | 69 | * @param string |
| 70 | 70 | * |
| 71 | - * @return boolean |
|
| 71 | + * @return null|boolean |
|
| 72 | 72 | */ |
| 73 | 73 | public function connect($host, $user, $passwd, $db = '') |
| 74 | 74 | { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param integer $offset |
| 100 | 100 | * @param integer $rowcount |
| 101 | 101 | * |
| 102 | - * @return mixed $result |
|
| 102 | + * @return SQLiteResult $result |
|
| 103 | 103 | */ |
| 104 | 104 | public function query($query, $offset = 0, $rowcount = 0) |
| 105 | 105 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * Fetch a result row as an associate array |
| 147 | 147 | * |
| 148 | - * @param mixed $result |
|
| 148 | + * @param SQLiteResult $result |
|
| 149 | 149 | * @return array |
| 150 | 150 | */ |
| 151 | 151 | public function fetchArray($result) |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | /** |
| 180 | 180 | * Number of rows in a result |
| 181 | 181 | * |
| 182 | - * @param mixed $result |
|
| 182 | + * @param SQLiteResult $result |
|
| 183 | 183 | * @return integer |
| 184 | 184 | */ |
| 185 | 185 | public function numRows($result) |
@@ -190,8 +190,7 @@ discard block |
||
| 190 | 190 | /** |
| 191 | 191 | * Logs the queries |
| 192 | 192 | * |
| 193 | - * @param mixed $result |
|
| 194 | - * @return integer |
|
| 193 | + * @return string |
|
| 195 | 194 | */ |
| 196 | 195 | public function log() |
| 197 | 196 | { |
@@ -270,7 +269,7 @@ discard block |
||
| 270 | 269 | * |
| 271 | 270 | * @param string $prefix Table prefix |
| 272 | 271 | * |
| 273 | - * @return array |
|
| 272 | + * @return string[] |
|
| 274 | 273 | */ |
| 275 | 274 | public function getTableNames($prefix = '') |
| 276 | 275 | { |
@@ -324,7 +323,7 @@ discard block |
||
| 324 | 323 | /** |
| 325 | 324 | * Closes the connection to the database. |
| 326 | 325 | * |
| 327 | - * @return boolean |
|
| 326 | + * @return boolean|null |
|
| 328 | 327 | */ |
| 329 | 328 | public function close() |
| 330 | 329 | { |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | */ |
| 117 | 117 | public function escape($string) |
| 118 | 118 | { |
| 119 | - return sqlite_escape_string($string); |
|
| 119 | + return sqlite_escape_string($string); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | $ret = []; |
| 158 | 158 | if (false === $result) { |
| 159 | - throw new Exception('Error while fetching result: ' . $this->error()); |
|
| 159 | + throw new Exception('Error while fetching result: '.$this->error()); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | while ($row = $this->fetchObject($result)) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // First, declare those tables that are referenced by others |
| 266 | 266 | $this->tableNames[] = $prefix.'faquser'; |
| 267 | 267 | |
| 268 | - $result = $this->query("SELECT name FROM sqlite_master WHERE type='table' ".(('' == $prefix) ? '': "AND name LIKE '".$prefix."%' ")."ORDER BY name"); |
|
| 268 | + $result = $this->query("SELECT name FROM sqlite_master WHERE type='table' ".(('' == $prefix) ? '' : "AND name LIKE '".$prefix."%' ")."ORDER BY name"); |
|
| 269 | 269 | while ($row = $this->fetchObject($result)) { |
| 270 | 270 | if (!in_array($row->name, $this->tableNames)) { |
| 271 | 271 | $this->tableNames[] = $row->name; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * SQL Server Authentication |
| 75 | 75 | * @param string $database Specifies the name of the database in use for the connection being established |
| 76 | 76 | * |
| 77 | - * @return boolean true, if connected, otherwise false |
|
| 77 | + * @return null|boolean true, if connected, otherwise false |
|
| 78 | 78 | */ |
| 79 | 79 | public function connect($host, $user, $password, $database = '') |
| 80 | 80 | { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @param integer $offset |
| 114 | 114 | * @param integer $rowcount |
| 115 | 115 | * |
| 116 | - * @return mixed $result |
|
| 116 | + * @return resource $result |
|
| 117 | 117 | */ |
| 118 | 118 | public function query($query, $offset = 0, $rowcount = 0) |
| 119 | 119 | { |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * Logs the queries |
| 209 | 209 | * |
| 210 | - * @return integer |
|
| 210 | + * @return string |
|
| 211 | 211 | */ |
| 212 | 212 | public function log() |
| 213 | 213 | { |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | /** |
| 268 | 268 | * Returns the error string. |
| 269 | 269 | * |
| 270 | - * @return mixed |
|
| 270 | + * @return string|null |
|
| 271 | 271 | */ |
| 272 | 272 | public function error() |
| 273 | 273 | { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * |
| 310 | 310 | * @param string $prefix Table prefix |
| 311 | 311 | * |
| 312 | - * @return array |
|
| 312 | + * @return string[] |
|
| 313 | 313 | */ |
| 314 | 314 | public function getTableNames($prefix = '') |
| 315 | 315 | { |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | private function setConnectionOptions($user, $passwd, $database) |
| 101 | 101 | { |
| 102 | 102 | $this->connectionOptions = array( |
| 103 | - 'UID' => $user, |
|
| 104 | - 'PWD' => $passwd, |
|
| 105 | - 'Database' => $database, |
|
| 106 | - 'CharacterSet' => 'UTF-8'); |
|
| 103 | + 'UID' => $user, |
|
| 104 | + 'PWD' => $passwd, |
|
| 105 | + 'Database' => $database, |
|
| 106 | + 'CharacterSet' => 'UTF-8'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | max(%s) as current_id |
| 257 | 257 | FROM |
| 258 | 258 | %s", |
| 259 | - $id, |
|
| 260 | - $table); |
|
| 259 | + $id, |
|
| 260 | + $table); |
|
| 261 | 261 | |
| 262 | 262 | $result = $this->query($select); |
| 263 | 263 | sqlsrv_fetch($result); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $query .= sprintf(' OFFSET %d ROWS FETCH NEXT %d ROWS ONLY', $offset, $rowcount); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $result = sqlsrv_query($this->conn, $query, [], $options); |
|
| 130 | + $result = sqlsrv_query($this->conn, $query, [], $options); |
|
| 131 | 131 | |
| 132 | 132 | if (!$result) { |
| 133 | 133 | $this->sqllog .= $this->error(); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | $ret = []; |
| 184 | 184 | if (false === $result) { |
| 185 | - throw new Exception('Error while fetching result: ' . $this->error()); |
|
| 185 | + throw new Exception('Error while fetching result: '.$this->error()); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | while ($row = $this->fetchObject($result)) { |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $errors = sqlsrv_errors(); |
| 275 | 275 | |
| 276 | 276 | if (null !== $errors) { |
| 277 | - return $errors[0]['SQLSTATE'] . ': ' . $errors[0]['message']; |
|
| 277 | + return $errors[0]['SQLSTATE'].': '.$errors[0]['message']; |
|
| 278 | 278 | } else { |
| 279 | 279 | return null; |
| 280 | 280 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function clientVersion() |
| 289 | 289 | { |
| 290 | 290 | $client_info = sqlsrv_client_info($this->conn); |
| 291 | - return $client_info['DriverODBCVer'] . ' ' . $client_info['DriverVer']; |
|
| 291 | + return $client_info['DriverODBCVer'].' '.$client_info['DriverVer']; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | * @param array $categories Array of categories |
| 1026 | 1026 | * @param integer $record_id Record id |
| 1027 | 1027 | * @param string $language Language |
| 1028 | - * @return integer |
|
| 1028 | + * @return boolean |
|
| 1029 | 1029 | */ |
| 1030 | 1030 | public function addCategoryRelations(Array $categories, $record_id, $language) |
| 1031 | 1031 | { |
@@ -1447,7 +1447,7 @@ discard block |
||
| 1447 | 1447 | * |
| 1448 | 1448 | * @param integer $record_id Record id |
| 1449 | 1449 | * @param string $record_lang Record language |
| 1450 | - * @return array |
|
| 1450 | + * @return boolean |
|
| 1451 | 1451 | */ |
| 1452 | 1452 | public function addNewRevision($record_id, $record_lang) |
| 1453 | 1453 | { |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | /** |
| 2156 | 2156 | * Returns a new question |
| 2157 | 2157 | * |
| 2158 | - * @param integer $question_id |
|
| 2158 | + * @param integer $id_question |
|
| 2159 | 2159 | * @return array |
| 2160 | 2160 | * @access public |
| 2161 | 2161 | * @since 2006-11-11 |
@@ -2409,7 +2409,7 @@ discard block |
||
| 2409 | 2409 | * Build a logic sequence, for a WHERE statement, of those category IDs |
| 2410 | 2410 | * children of the provided category ID, if any |
| 2411 | 2411 | * |
| 2412 | - * @param $nCatid |
|
| 2412 | + * @param integer $nCatid |
|
| 2413 | 2413 | * @param $logicOp |
| 2414 | 2414 | * @param $oCat |
| 2415 | 2415 | * @return string |
@@ -2437,13 +2437,13 @@ discard block |
||
| 2437 | 2437 | /** |
| 2438 | 2438 | * Build the SQL query for retrieving faq records according to the constraints provided |
| 2439 | 2439 | * |
| 2440 | - * @param $QueryType |
|
| 2441 | - * @param $nCatid |
|
| 2442 | - * @param $bDownwards |
|
| 2443 | - * @param $lang |
|
| 2444 | - * @param $date |
|
| 2440 | + * @param string $QueryType |
|
| 2441 | + * @param integer $nCatid |
|
| 2442 | + * @param boolean $bDownwards |
|
| 2443 | + * @param string $lang |
|
| 2444 | + * @param string $date |
|
| 2445 | 2445 | * @param $faqid |
| 2446 | - * @return array |
|
| 2446 | + * @return string |
|
| 2447 | 2447 | * @access private |
| 2448 | 2448 | * @since 2005-11-02 |
| 2449 | 2449 | * @author Matteo Scaramuccia <[email protected]> |
@@ -75,31 +75,31 @@ discard block |
||
| 75 | 75 | private $_config; |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Language strings |
|
| 79 | - * |
|
| 80 | - * @var string |
|
| 81 | - */ |
|
| 78 | + * Language strings |
|
| 79 | + * |
|
| 80 | + * @var string |
|
| 81 | + */ |
|
| 82 | 82 | private $pmf_lang; |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * Plural form support |
|
| 86 | - * |
|
| 87 | - * @var PMF_Language_Plurals |
|
| 88 | - */ |
|
| 85 | + * Plural form support |
|
| 86 | + * |
|
| 87 | + * @var PMF_Language_Plurals |
|
| 88 | + */ |
|
| 89 | 89 | private $plr; |
| 90 | 90 | |
| 91 | 91 | /** |
| 92 | - * The current FAQ record |
|
| 93 | - * |
|
| 94 | - * @var array |
|
| 95 | - */ |
|
| 92 | + * The current FAQ record |
|
| 93 | + * |
|
| 94 | + * @var array |
|
| 95 | + */ |
|
| 96 | 96 | public $faqRecord = array(); |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * All current FAQ records in an array |
|
| 100 | - * |
|
| 101 | - * @var array |
|
| 102 | - */ |
|
| 99 | + * All current FAQ records in an array |
|
| 100 | + * |
|
| 101 | + * @var array |
|
| 102 | + */ |
|
| 103 | 103 | public $faqRecords = array(); |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -1184,8 +1184,8 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | if ($row = $this->_config->getDb()->fetchObject($result)) { |
| 1186 | 1186 | return array('id' => $row->id, |
| 1187 | - 'lang' => $row->lang, |
|
| 1188 | - 'content' => $row->content); |
|
| 1187 | + 'lang' => $row->lang, |
|
| 1188 | + 'content' => $row->content); |
|
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | return null; |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | */ |
| 1513 | 1513 | public function getRecordPreview($recordId, $wordCount = 12) |
| 1514 | 1514 | { |
| 1515 | - $answerPreview = ''; |
|
| 1515 | + $answerPreview = ''; |
|
| 1516 | 1516 | |
| 1517 | 1517 | if (isset($this->faqRecord['id']) && ($this->faqRecord['id'] == $recordId)) { |
| 1518 | 1518 | $answerPreview = $this->faqRecord['content']; |
@@ -1677,8 +1677,8 @@ discard block |
||
| 1677 | 1677 | * @since 2006-11-04 |
| 1678 | 1678 | * @author Thorsten Rinne <[email protected]> |
| 1679 | 1679 | */ |
| 1680 | - function getVisibilityOfQuestion($question_id) |
|
| 1681 | - { |
|
| 1680 | + function getVisibilityOfQuestion($question_id) |
|
| 1681 | + { |
|
| 1682 | 1682 | $query = sprintf(' |
| 1683 | 1683 | SELECT |
| 1684 | 1684 | is_visible |
@@ -1695,7 +1695,7 @@ discard block |
||
| 1695 | 1695 | return $row->is_visible; |
| 1696 | 1696 | } |
| 1697 | 1697 | return null; |
| 1698 | - } |
|
| 1698 | + } |
|
| 1699 | 1699 | |
| 1700 | 1700 | /** |
| 1701 | 1701 | * Sets the visibilty of a question |
@@ -2210,8 +2210,8 @@ discard block |
||
| 2210 | 2210 | * @param $all boolean If true, then return visible and unvisble questions; otherwise only visible ones |
| 2211 | 2211 | * @return array |
| 2212 | 2212 | */ |
| 2213 | - public function getAllOpenQuestions($all = true) |
|
| 2214 | - { |
|
| 2213 | + public function getAllOpenQuestions($all = true) |
|
| 2214 | + { |
|
| 2215 | 2215 | $questions = array(); |
| 2216 | 2216 | |
| 2217 | 2217 | $query = sprintf(" |
@@ -2240,7 +2240,7 @@ discard block |
||
| 2240 | 2240 | } |
| 2241 | 2241 | } |
| 2242 | 2242 | return $questions; |
| 2243 | - } |
|
| 2243 | + } |
|
| 2244 | 2244 | |
| 2245 | 2245 | /** |
| 2246 | 2246 | * Updates an existing voting record |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | $record_id |
| 2348 | 2348 | ); |
| 2349 | 2349 | |
| 2350 | - if ($result = $this->_config->getDb()->query($query)) { |
|
| 2350 | + if ($result = $this->_config->getDb()->query($query)) { |
|
| 2351 | 2351 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
| 2352 | 2352 | $entries[] = array( |
| 2353 | 2353 | 'revision_id' => $row->revision_id, |
@@ -2435,19 +2435,19 @@ discard block |
||
| 2435 | 2435 | } |
| 2436 | 2436 | |
| 2437 | 2437 | /** |
| 2438 | - * Build the SQL query for retrieving faq records according to the constraints provided |
|
| 2439 | - * |
|
| 2440 | - * @param $QueryType |
|
| 2441 | - * @param $nCatid |
|
| 2442 | - * @param $bDownwards |
|
| 2443 | - * @param $lang |
|
| 2444 | - * @param $date |
|
| 2445 | - * @param $faqid |
|
| 2446 | - * @return array |
|
| 2447 | - * @access private |
|
| 2448 | - * @since 2005-11-02 |
|
| 2449 | - * @author Matteo Scaramuccia <[email protected]> |
|
| 2450 | - */ |
|
| 2438 | + * Build the SQL query for retrieving faq records according to the constraints provided |
|
| 2439 | + * |
|
| 2440 | + * @param $QueryType |
|
| 2441 | + * @param $nCatid |
|
| 2442 | + * @param $bDownwards |
|
| 2443 | + * @param $lang |
|
| 2444 | + * @param $date |
|
| 2445 | + * @param $faqid |
|
| 2446 | + * @return array |
|
| 2447 | + * @access private |
|
| 2448 | + * @since 2005-11-02 |
|
| 2449 | + * @author Matteo Scaramuccia <[email protected]> |
|
| 2450 | + */ |
|
| 2451 | 2451 | private function _getSQLQuery($QueryType, $nCatid, $bDownwards, $lang, $date, $faqid = 0) |
| 2452 | 2452 | { |
| 2453 | 2453 | $now = date('YmdHis'); |
@@ -28,20 +28,20 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * SQL constants definitions |
| 30 | 30 | */ |
| 31 | -define('FAQ_SQL_YES', 'y'); |
|
| 32 | -define('FAQ_SQL_NO', 'n'); |
|
| 31 | +define('FAQ_SQL_YES', 'y'); |
|
| 32 | +define('FAQ_SQL_NO', 'n'); |
|
| 33 | 33 | define('FAQ_SQL_ACTIVE_YES', 'yes'); |
| 34 | -define('FAQ_SQL_ACTIVE_NO', 'no'); |
|
| 34 | +define('FAQ_SQL_ACTIVE_NO', 'no'); |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Query type definitions |
| 38 | 38 | */ |
| 39 | -define('FAQ_QUERY_TYPE_DEFAULT', 'faq_default'); |
|
| 40 | -define('FAQ_QUERY_TYPE_APPROVAL', 'faq_approval'); |
|
| 41 | -define('FAQ_QUERY_TYPE_EXPORT_PDF', 'faq_export_pdf'); |
|
| 39 | +define('FAQ_QUERY_TYPE_DEFAULT', 'faq_default'); |
|
| 40 | +define('FAQ_QUERY_TYPE_APPROVAL', 'faq_approval'); |
|
| 41 | +define('FAQ_QUERY_TYPE_EXPORT_PDF', 'faq_export_pdf'); |
|
| 42 | 42 | define('FAQ_QUERY_TYPE_EXPORT_XHTML', 'faq_export_xhtml'); |
| 43 | -define('FAQ_QUERY_TYPE_EXPORT_XML', 'faq_export_xml'); |
|
| 44 | -define('FAQ_QUERY_TYPE_RSS_LATEST', 'faq_rss_latest'); |
|
| 43 | +define('FAQ_QUERY_TYPE_EXPORT_XML', 'faq_export_xml'); |
|
| 44 | +define('FAQ_QUERY_TYPE_RSS_LATEST', 'faq_rss_latest'); |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Sorting type definitions |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $visits = $row->visits; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $url = sprintf( |
|
| 259 | + $url = sprintf( |
|
| 260 | 260 | '%s?%saction=artikel&cat=%d&id=%d&artlang=%s', |
| 261 | 261 | PMF_Link::getSystemRelativeUri(), |
| 262 | 262 | $sids, |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $row->lang |
| 266 | 266 | ); |
| 267 | 267 | $oLink = new PMF_Link($url, $this->_config); |
| 268 | - $oLink->itemTitle = $oLink->text = $oLink->tooltip = $row->thema;; |
|
| 268 | + $oLink->itemTitle = $oLink->text = $oLink->tooltip = $row->thema; ; |
|
| 269 | 269 | |
| 270 | 270 | $faqdata[] = array( |
| 271 | 271 | 'record_id' => $row->id, |
@@ -379,20 +379,20 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | $result = $this->_config->getDb()->query($query); |
| 381 | 381 | $num = $this->_config->getDb()->numRows($result); |
| 382 | - $pages = (int)ceil($num / $numPerPage); |
|
| 382 | + $pages = (int)ceil($num/$numPerPage); |
|
| 383 | 383 | |
| 384 | 384 | if ($page == 1) { |
| 385 | 385 | $first = 0; |
| 386 | 386 | } else { |
| 387 | - $first = $page * $numPerPage - $numPerPage; |
|
| 387 | + $first = $page*$numPerPage - $numPerPage; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | if ($num > 0) { |
| 391 | 391 | if ($pages > 1) { |
| 392 | 392 | $output .= sprintf('<p><strong>%s %s %s</strong></p>', |
| 393 | - $this->pmf_lang['msgPage'] . $page, |
|
| 393 | + $this->pmf_lang['msgPage'].$page, |
|
| 394 | 394 | $this->pmf_lang['msgVoteFrom'], |
| 395 | - $pages . $this->pmf_lang['msgPages']); |
|
| 395 | + $pages.$this->pmf_lang['msgPages']); |
|
| 396 | 396 | } |
| 397 | 397 | $output .= '<ul class="phpmyfaq_ul">'; |
| 398 | 398 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $displayedCounter = 0; |
| 401 | 401 | $renderedItems = []; |
| 402 | 402 | while (($row = $this->_config->getDb()->fetchObject($result)) && $displayedCounter < $numPerPage) { |
| 403 | - $counter ++; |
|
| 403 | + $counter++; |
|
| 404 | 404 | if ($counter <= $first) { |
| 405 | 405 | continue; |
| 406 | 406 | } |
@@ -564,20 +564,20 @@ discard block |
||
| 564 | 564 | $result = $this->_config->getDb()->query($query); |
| 565 | 565 | |
| 566 | 566 | $num = $this->_config->getDb()->numRows($result); |
| 567 | - $pages = ceil($num / $this->_config->get('records.numberOfRecordsPerPage')); |
|
| 567 | + $pages = ceil($num/$this->_config->get('records.numberOfRecordsPerPage')); |
|
| 568 | 568 | |
| 569 | 569 | if ($page == 1) { |
| 570 | 570 | $first = 0; |
| 571 | 571 | } else { |
| 572 | - $first = ($page * $this->_config->get('records.numberOfRecordsPerPage')) - $this->_config->get('records.numberOfRecordsPerPage'); |
|
| 572 | + $first = ($page*$this->_config->get('records.numberOfRecordsPerPage')) - $this->_config->get('records.numberOfRecordsPerPage'); |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | if ($num > 0) { |
| 576 | 576 | if ($pages > 1) { |
| 577 | 577 | $output .= sprintf('<p><strong>%s %s %s</strong></p>', |
| 578 | - $this->pmf_lang['msgPage'] . $page, |
|
| 578 | + $this->pmf_lang['msgPage'].$page, |
|
| 579 | 579 | $this->pmf_lang['msgVoteFrom'], |
| 580 | - $pages . $this->pmf_lang['msgPages']); |
|
| 580 | + $pages.$this->pmf_lang['msgPages']); |
|
| 581 | 581 | } |
| 582 | 582 | $output .= '<ul class="phpmyfaq_ul">'; |
| 583 | 583 | $counter = 0; |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | |
| 586 | 586 | $lastFaqId = 0; |
| 587 | 587 | while (($row = $this->_config->getDb()->fetchObject($result)) && $displayedCounter < $this->_config->get('records.numberOfRecordsPerPage')) { |
| 588 | - $counter ++; |
|
| 588 | + $counter++; |
|
| 589 | 589 | if ($counter <= $first) { |
| 590 | 590 | continue; |
| 591 | 591 | } |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $listItem = sprintf( |
| 618 | 618 | '<li>%s<br /><small>(%s)</small></li>', |
| 619 | 619 | $oLink->toHtmlAnchor(), |
| 620 | - $this->plr->GetMsg('plmsgViews',$visits) |
|
| 620 | + $this->plr->GetMsg('plmsgViews', $visits) |
|
| 621 | 621 | ); |
| 622 | 622 | |
| 623 | 623 | $output .= $listItem; |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | fd.lang = '%s' |
| 695 | 695 | %s", |
| 696 | 696 | PMF_Db::getTablePrefix(), |
| 697 | - isset($revisionId) ? 'faqdata_revisions': 'faqdata', |
|
| 697 | + isset($revisionId) ? 'faqdata_revisions' : 'faqdata', |
|
| 698 | 698 | PMF_Db::getTablePrefix(), |
| 699 | 699 | PMF_Db::getTablePrefix(), |
| 700 | 700 | $id, |
@@ -1635,9 +1635,9 @@ discard block |
||
| 1635 | 1635 | $result = $this->getLatestData(PMF_NUMBER_RECORDS_LATEST, $this->_config->getLanguage()->getLanguage()); |
| 1636 | 1636 | $output = []; |
| 1637 | 1637 | |
| 1638 | - if (count ($result) > 0) { |
|
| 1638 | + if (count($result) > 0) { |
|
| 1639 | 1639 | foreach ($result as $row) { |
| 1640 | - $output['url'][] = $row['url']; |
|
| 1640 | + $output['url'][] = $row['url']; |
|
| 1641 | 1641 | $output['title'][] = PMF_Utils::makeShorterText($row['thema'], 8); |
| 1642 | 1642 | $output['preview'][] = $row['thema']; |
| 1643 | 1643 | $output['date'][] = $date->format(PMF_Date::createIsoDate($row['datum'])); |
@@ -1783,7 +1783,7 @@ discard block |
||
| 1783 | 1783 | fd.lang = \''.$language.'\''; |
| 1784 | 1784 | } |
| 1785 | 1785 | $query .= ' |
| 1786 | - ' . $this->queryPermission($this->groupSupport) . ' |
|
| 1786 | + ' . $this->queryPermission($this->groupSupport).' |
|
| 1787 | 1787 | ORDER BY |
| 1788 | 1788 | avg DESC'; |
| 1789 | 1789 | |
@@ -1882,7 +1882,7 @@ discard block |
||
| 1882 | 1882 | fd.lang = \''.$language.'\''; |
| 1883 | 1883 | } |
| 1884 | 1884 | $query .= ' |
| 1885 | - ' . $this->queryPermission($this->groupSupport) . ' |
|
| 1885 | + ' . $this->queryPermission($this->groupSupport).' |
|
| 1886 | 1886 | |
| 1887 | 1887 | GROUP BY |
| 1888 | 1888 | id |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | fd.lang = \''.$language.'\''; |
| 1987 | 1987 | } |
| 1988 | 1988 | $query .= ' |
| 1989 | - ' . $this->queryPermission($this->groupSupport) . ' |
|
| 1989 | + ' . $this->queryPermission($this->groupSupport).' |
|
| 1990 | 1990 | GROUP BY |
| 1991 | 1991 | id |
| 1992 | 1992 | ORDER BY |
@@ -2291,7 +2291,7 @@ discard block |
||
| 2291 | 2291 | */ |
| 2292 | 2292 | function createChangeEntry($id, $userId, $text, $lang, $revision_id = 0) |
| 2293 | 2293 | { |
| 2294 | - if ( !is_numeric($id) |
|
| 2294 | + if (!is_numeric($id) |
|
| 2295 | 2295 | && !is_numeric($userId) |
| 2296 | 2296 | && !is_string($text) |
| 2297 | 2297 | && !is_string($lang) |
@@ -2850,7 +2850,7 @@ discard block |
||
| 2850 | 2850 | ); |
| 2851 | 2851 | } |
| 2852 | 2852 | |
| 2853 | - return $output . $extraout; |
|
| 2853 | + return $output.$extraout; |
|
| 2854 | 2854 | } |
| 2855 | 2855 | |
| 2856 | 2856 | /** |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | /** |
| 164 | 164 | * Get all categories in <option> tags |
| 165 | 165 | * |
| 166 | - * @param array|integer $categoryId Category ID or array of category IDs |
|
| 166 | + * @param integer $categoryId Category ID or array of category IDs |
|
| 167 | 167 | * |
| 168 | 168 | * @return string |
| 169 | 169 | */ |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $numFaqs = $this->Category->getNumberOfRecordsOfCategory(); |
| 61 | 61 | |
| 62 | 62 | if ($numCategories > 0) { |
| 63 | - for ($y = 0 ;$y < $numCategories; $y = $this->Category->getNextLineTree($y)) { |
|
| 63 | + for ($y = 0; $y < $numCategories; $y = $this->Category->getNextLineTree($y)) { |
|
| 64 | 64 | |
| 65 | 65 | list($hasChild, $name, $categoryId, $description) = $this->Category->getLineDisplay($y); |
| 66 | 66 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | if ($numCategories > 0) { |
| 165 | 165 | |
| 166 | - for ($y = 0 ;$y < $this->Category->height(); $y = $this->Category->getNextLineTree($y)) { |
|
| 166 | + for ($y = 0; $y < $this->Category->height(); $y = $this->Category->getNextLineTree($y)) { |
|
| 167 | 167 | |
| 168 | 168 | list($hasChild, $categoryName, $parent, $description) = $this->Category->getLineDisplay($y); |
| 169 | 169 | $level = $this->Category->treeTab[$y]['level']; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $categories .= ">"; |
| 310 | - $categories .= $indent . $cat['name'] . "</option>\n"; |
|
| 310 | + $categories .= $indent.$cat['name']."</option>\n"; |
|
| 311 | 311 | $i++; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * Returns all instances |
| 121 | 121 | * |
| 122 | - * @return array |
|
| 122 | + * @return PMF_DB_Driver |
|
| 123 | 123 | */ |
| 124 | 124 | public function getAllInstances() |
| 125 | 125 | { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * Adds a configuration item for the database |
| 262 | 262 | * |
| 263 | 263 | * @param string $name |
| 264 | - * @param mixed $value |
|
| 264 | + * @param string $value |
|
| 265 | 265 | * |
| 266 | 266 | * @return boolean |
| 267 | 267 | */ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function addInstance(Array $data) |
| 78 | 78 | { |
| 79 | - $this->setId($this->config->getDb()->nextId(PMF_Db::getTablePrefix() . 'faqinstances', 'id')); |
|
| 79 | + $this->setId($this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faqinstances', 'id')); |
|
| 80 | 80 | |
| 81 | 81 | $insert = sprintf( |
| 82 | 82 | "INSERT INTO %sfaqinstances VALUES (%d, '%s', '%s', '%s', %s, %s)", |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $this->config->getDb()->now() |
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | - if (! $this->config->getDb()->query($insert)) { |
|
| 92 | + if (!$this->config->getDb()->query($insert)) { |
|
| 93 | 93 | return 0; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | foreach ($deletes as $delete) { |
| 251 | 251 | $success = $this->config->getDb()->query($delete); |
| 252 | - if (! $success) { |
|
| 252 | + if (!$success) { |
|
| 253 | 253 | return false; |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | public function getConfig($name) |
| 292 | 292 | { |
| 293 | - if (! isset($this->instanceConfig[$name])) { |
|
| 293 | + if (!isset($this->instanceConfig[$name])) { |
|
| 294 | 294 | $this->getInstanceConfig($this->getId()); |
| 295 | 295 | } |
| 296 | 296 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @param string $prefix SQL table prefix |
| 96 | 96 | * |
| 97 | - * @return bool |
|
| 97 | + * @return boolean|null |
|
| 98 | 98 | */ |
| 99 | 99 | public function createClientTables($prefix) |
| 100 | 100 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * @param string $dest Destination folder |
| 193 | 193 | * @param string $templateDir Template folder |
| 194 | 194 | * |
| 195 | - * @return bool |
|
| 195 | + * @return boolean|null |
|
| 196 | 196 | */ |
| 197 | 197 | public function copyTemplateFolder($dest, $templateDir = 'default') |
| 198 | 198 | { |
@@ -76,17 +76,17 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function createClientFolder($hostname) |
| 78 | 78 | { |
| 79 | - $clientDir = PMF_ROOT_DIR . '/multisite/'; |
|
| 79 | + $clientDir = PMF_ROOT_DIR.'/multisite/'; |
|
| 80 | 80 | |
| 81 | 81 | if (!$this->fileSystem instanceof PMF_Filesystem) { |
| 82 | 82 | $this->fileSystem = new PMF_Filesystem(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if (! is_writeable($clientDir)) { |
|
| 85 | + if (!is_writeable($clientDir)) { |
|
| 86 | 86 | return false; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - return $this->fileSystem->mkdir($clientDir . $hostname); |
|
| 89 | + return $this->fileSystem->mkdir($clientDir.$hostname); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function copyConstantsFile($dest) |
| 166 | 166 | { |
| 167 | 167 | return $this->fileSystem->copy( |
| 168 | - $this->fileSystem->getRootPath() . '/config/constants.php', |
|
| 168 | + $this->fileSystem->getRootPath().'/config/constants.php', |
|
| 169 | 169 | $dest |
| 170 | 170 | ); |
| 171 | 171 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | public function copyLdapConstantsFile($dest) |
| 181 | 181 | { |
| 182 | 182 | return $this->fileSystem->copy( |
| 183 | - $this->fileSystem->getRootPath() . '/config/constants_ldap.php', |
|
| 183 | + $this->fileSystem->getRootPath().'/config/constants_ldap.php', |
|
| 184 | 184 | $dest |
| 185 | 185 | ); |
| 186 | 186 | } |
@@ -196,8 +196,8 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function copyTemplateFolder($dest, $templateDir = 'default') |
| 198 | 198 | { |
| 199 | - $sourceTpl = $this->fileSystem->getRootPath() . '/assets/template/' . $templateDir; |
|
| 200 | - $destTpl = $dest . '/assets/template/'; |
|
| 199 | + $sourceTpl = $this->fileSystem->getRootPath().'/assets/template/'.$templateDir; |
|
| 200 | + $destTpl = $dest.'/assets/template/'; |
|
| 201 | 201 | |
| 202 | 202 | $this->fileSystem->recursiveCopy($sourceTpl, $destTpl); |
| 203 | 203 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * Checks basic folders and creates them if necessary |
| 83 | 83 | * |
| 84 | - * @param array $dirs |
|
| 84 | + * @param string[] $dirs |
|
| 85 | 85 | * |
| 86 | 86 | * @return array |
| 87 | 87 | */ |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param string $name Name of the new folder |
| 163 | 163 | * @param string $path Path to the new folder |
| 164 | 164 | * |
| 165 | - * @return bool |
|
| 165 | + * @return boolean|null |
|
| 166 | 166 | */ |
| 167 | 167 | public function createFolder($name, $path) |
| 168 | 168 | { |
@@ -90,16 +90,16 @@ discard block |
||
| 90 | 90 | $failedDirs = []; |
| 91 | 91 | |
| 92 | 92 | foreach ($dirs as $dir) { |
| 93 | - if (false === is_writable($this->_rootDir . $dir)) { |
|
| 93 | + if (false === is_writable($this->_rootDir.$dir)) { |
|
| 94 | 94 | $failedDirs[] = $dir; |
| 95 | - } elseif (false === is_dir($this->_rootDir . $dir)) { |
|
| 96 | - if (false === mkdir($this->_rootDir . $dir, 0755)) { |
|
| 95 | + } elseif (false === is_dir($this->_rootDir.$dir)) { |
|
| 96 | + if (false === mkdir($this->_rootDir.$dir, 0755)) { |
|
| 97 | 97 | $failedDirs[] = $dir; |
| 98 | 98 | } |
| 99 | 99 | } else { |
| 100 | 100 | copy( |
| 101 | - $this->_rootDir . '/setup/index.html', |
|
| 102 | - $this->_rootDir . $dir . '/index.html' |
|
| 101 | + $this->_rootDir.'/setup/index.html', |
|
| 102 | + $this->_rootDir.$dir.'/index.html' |
|
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -118,15 +118,15 @@ discard block |
||
| 118 | 118 | public function createDatabaseFile(Array $data, $folder = '/config') |
| 119 | 119 | { |
| 120 | 120 | $ret = file_put_contents( |
| 121 | - $this->_rootDir . $folder . '/database.php', |
|
| 122 | - "<?php\n" . |
|
| 123 | - "\$DB['server'] = '" . $data['dbServer'] . "';\n" . |
|
| 124 | - "\$DB['port'] = '" . $data['dbPort'] . "';\n" . |
|
| 125 | - "\$DB['user'] = '" . $data['dbUser'] . "';\n" . |
|
| 126 | - "\$DB['password'] = '" . $data['dbPassword'] . "';\n" . |
|
| 127 | - "\$DB['db'] = '" . $data['dbDatabaseName'] . "';\n" . |
|
| 128 | - "\$DB['prefix'] = '" . $data['dbPrefix'] . "';\n" . |
|
| 129 | - "\$DB['type'] = '" . $data['dbType'] . "';", |
|
| 121 | + $this->_rootDir.$folder.'/database.php', |
|
| 122 | + "<?php\n". |
|
| 123 | + "\$DB['server'] = '".$data['dbServer']."';\n". |
|
| 124 | + "\$DB['port'] = '".$data['dbPort']."';\n". |
|
| 125 | + "\$DB['user'] = '".$data['dbUser']."';\n". |
|
| 126 | + "\$DB['password'] = '".$data['dbPassword']."';\n". |
|
| 127 | + "\$DB['db'] = '".$data['dbDatabaseName']."';\n". |
|
| 128 | + "\$DB['prefix'] = '".$data['dbPrefix']."';\n". |
|
| 129 | + "\$DB['type'] = '".$data['dbType']."';", |
|
| 130 | 130 | LOCK_EX |
| 131 | 131 | ); |
| 132 | 132 | |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | public function createLdapFile(Array $data, $folder = '/config') |
| 145 | 145 | { |
| 146 | 146 | $ret = file_put_contents( |
| 147 | - $this->_rootDir . $folder . '/config/ldap.php', |
|
| 148 | - "<?php\n" . |
|
| 149 | - "\$PMF_LDAP['ldap_server'] = '" . $data['ldapServer'] . "';\n" . |
|
| 150 | - "\$PMF_LDAP['ldap_port'] = '" . $data['ldapPort'] . "';\n" . |
|
| 151 | - "\$PMF_LDAP['ldap_user'] = '" . $data['ldapUser'] . "';\n" . |
|
| 152 | - "\$PMF_LDAP['ldap_password'] = '" . $data['ldapPassword'] . "';\n" . |
|
| 153 | - "\$PMF_LDAP['ldap_base'] = '" . $data['ldapBase'] . "';", |
|
| 147 | + $this->_rootDir.$folder.'/config/ldap.php', |
|
| 148 | + "<?php\n". |
|
| 149 | + "\$PMF_LDAP['ldap_server'] = '".$data['ldapServer']."';\n". |
|
| 150 | + "\$PMF_LDAP['ldap_port'] = '".$data['ldapPort']."';\n". |
|
| 151 | + "\$PMF_LDAP['ldap_user'] = '".$data['ldapUser']."';\n". |
|
| 152 | + "\$PMF_LDAP['ldap_password'] = '".$data['ldapPassword']."';\n". |
|
| 153 | + "\$PMF_LDAP['ldap_base'] = '".$data['ldapBase']."';", |
|
| 154 | 154 | LOCK_EX |
| 155 | 155 | ); |
| 156 | 156 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | /** |
| 354 | 354 | * Returns the HTTP GET parameters |
| 355 | 355 | * |
| 356 | - * @return array |
|
| 356 | + * @return string |
|
| 357 | 357 | */ |
| 358 | 358 | protected function getHttpGetParameters() |
| 359 | 359 | { |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | * @param string $text Text |
| 748 | 748 | * @param bool $active Add CSS class named "active"? |
| 749 | 749 | * |
| 750 | - * @return string |
|
| 750 | + * @return integer |
|
| 751 | 751 | */ |
| 752 | 752 | public static function renderNavigationLink($url, $text, $active = false) |
| 753 | 753 | { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $parameters = []; |
| 362 | 362 | |
| 363 | 363 | if (!empty($query)) { |
| 364 | - if (isset($query['fragment']) ) { |
|
| 364 | + if (isset($query['fragment'])) { |
|
| 365 | 365 | $parameters[self::PMF_LINK_FRAGMENT_SEPARATOR] = urldecode($query['fragment']); |
| 366 | 366 | } |
| 367 | 367 | $params = explode(self::PMF_LINK_AMPERSAND, $query['main']); |
@@ -426,8 +426,8 @@ discard block |
||
| 426 | 426 | return 'https://'; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | - $scheme = 'http' . (((!PMF_Link::isIISServer()) && isset($_SERVER['HTTPS'])) || |
|
| 430 | - ((PMF_Link::isIISServer()) && ('on' == strtolower($_SERVER['HTTPS']))) ? 's' : '') . '://'; |
|
| 429 | + $scheme = 'http'.(((!PMF_Link::isIISServer()) && isset($_SERVER['HTTPS'])) || |
|
| 430 | + ((PMF_Link::isIISServer()) && ('on' == strtolower($_SERVER['HTTPS']))) ? 's' : '').'://'; |
|
| 431 | 431 | |
| 432 | 432 | return $scheme; |
| 433 | 433 | } |
@@ -463,11 +463,11 @@ discard block |
||
| 463 | 463 | // being requested, as obtained from the original URI given by the user or referring resource |
| 464 | 464 | |
| 465 | 465 | // Remove any ref to standard ports 80 and 443. |
| 466 | - $pattern[0] = '/:80$/'; // HTTP: port 80 |
|
| 466 | + $pattern[0] = '/:80$/'; // HTTP: port 80 |
|
| 467 | 467 | $pattern[1] = '/:443$/'; // HTTPS: port 443 |
| 468 | - $sysUri = $this->getSystemScheme() . preg_replace($pattern, '', $_SERVER['HTTP_HOST']); |
|
| 468 | + $sysUri = $this->getSystemScheme().preg_replace($pattern, '', $_SERVER['HTTP_HOST']); |
|
| 469 | 469 | |
| 470 | - return $sysUri . PMF_link::getSystemRelativeUri($path); |
|
| 470 | + return $sysUri.PMF_link::getSystemRelativeUri($path); |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /** |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | self::PMF_LINK_SEARCHPART_SEPARATOR |
| 537 | 537 | : |
| 538 | 538 | self::PMF_LINK_AMPERSAND; |
| 539 | - return $url . $separator . self::PMF_LINK_GET_SIDS . self::PMF_LINK_EQUAL . $sids; |
|
| 539 | + return $url.$separator.self::PMF_LINK_GET_SIDS.self::PMF_LINK_EQUAL.$sids; |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | /** |
@@ -567,22 +567,22 @@ discard block |
||
| 567 | 567 | break; |
| 568 | 568 | |
| 569 | 569 | case self::PMF_LINK_GET_ACTION_ARTIKEL: |
| 570 | - $url .= self::PMF_LINK_CONTENT . |
|
| 571 | - $getParams[self::PMF_LINK_GET_CATEGORY] . |
|
| 572 | - self::PMF_LINK_HTML_SLASH . |
|
| 573 | - $getParams[self::PMF_LINK_GET_ID] . |
|
| 574 | - self::PMF_LINK_HTML_SLASH . |
|
| 575 | - $getParams[self::PMF_LINK_GET_ARTLANG] . |
|
| 576 | - self::PMF_LINK_SLASH . |
|
| 577 | - $this->getSEOItemTitle() . |
|
| 570 | + $url .= self::PMF_LINK_CONTENT. |
|
| 571 | + $getParams[self::PMF_LINK_GET_CATEGORY]. |
|
| 572 | + self::PMF_LINK_HTML_SLASH. |
|
| 573 | + $getParams[self::PMF_LINK_GET_ID]. |
|
| 574 | + self::PMF_LINK_HTML_SLASH. |
|
| 575 | + $getParams[self::PMF_LINK_GET_ARTLANG]. |
|
| 576 | + self::PMF_LINK_SLASH. |
|
| 577 | + $this->getSEOItemTitle(). |
|
| 578 | 578 | self::PMF_LINK_HTML_EXTENSION; |
| 579 | 579 | if (isset($getParams[self::PMF_LINK_GET_HIGHLIGHT])) { |
| 580 | - $url .= self::PMF_LINK_SEARCHPART_SEPARATOR . |
|
| 581 | - self::PMF_LINK_GET_HIGHLIGHT . '=' . |
|
| 580 | + $url .= self::PMF_LINK_SEARCHPART_SEPARATOR. |
|
| 581 | + self::PMF_LINK_GET_HIGHLIGHT.'='. |
|
| 582 | 582 | $getParams[self::PMF_LINK_GET_HIGHLIGHT]; |
| 583 | 583 | } |
| 584 | 584 | if (isset($getParams[self::PMF_LINK_FRAGMENT_SEPARATOR])) { |
| 585 | - $url .= self::PMF_LINK_FRAGMENT_SEPARATOR . |
|
| 585 | + $url .= self::PMF_LINK_FRAGMENT_SEPARATOR. |
|
| 586 | 586 | $getParams[self::PMF_LINK_FRAGMENT_SEPARATOR]; |
| 587 | 587 | } |
| 588 | 588 | break; |
@@ -614,37 +614,37 @@ discard block |
||
| 614 | 614 | if (isset($getParams[self::PMF_LINK_GET_PAGE])) { |
| 615 | 615 | $url .= self::PMF_LINK_HTML_SLASH.$getParams[self::PMF_LINK_GET_PAGE]; |
| 616 | 616 | } |
| 617 | - $url .= self::PMF_LINK_SLASH . |
|
| 618 | - $this->getSEOItemTitle() . |
|
| 617 | + $url .= self::PMF_LINK_SLASH. |
|
| 618 | + $this->getSEOItemTitle(). |
|
| 619 | 619 | self::PMF_LINK_HTML_EXTENSION; |
| 620 | 620 | } elseif (isset($getParams[self::PMF_LINK_GET_ACTION_SEARCH])) { |
| 621 | 621 | $url .= self::PMF_LINK_HTML_SEARCH; |
| 622 | - $url .= self::PMF_LINK_SEARCHPART_SEPARATOR . |
|
| 623 | - self::PMF_LINK_GET_ACTION_SEARCH . '=' . |
|
| 622 | + $url .= self::PMF_LINK_SEARCHPART_SEPARATOR. |
|
| 623 | + self::PMF_LINK_GET_ACTION_SEARCH.'='. |
|
| 624 | 624 | $getParams[self::PMF_LINK_GET_ACTION_SEARCH]; |
| 625 | 625 | if (isset($getParams[self::PMF_LINK_GET_PAGE])) { |
| 626 | - $url .= self::PMF_LINK_AMPERSAND.self::PMF_LINK_GET_PAGE . '=' . |
|
| 626 | + $url .= self::PMF_LINK_AMPERSAND.self::PMF_LINK_GET_PAGE.'='. |
|
| 627 | 627 | $getParams[self::PMF_LINK_GET_PAGE]; |
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | if (isset($getParams[self::PMF_LINK_GET_LANGS])) { |
| 631 | - $url .= self::PMF_LINK_AMPERSAND . |
|
| 632 | - self::PMF_LINK_GET_LANGS . '=' . |
|
| 631 | + $url .= self::PMF_LINK_AMPERSAND. |
|
| 632 | + self::PMF_LINK_GET_LANGS.'='. |
|
| 633 | 633 | $getParams[self::PMF_LINK_GET_LANGS]; |
| 634 | 634 | } |
| 635 | 635 | break; |
| 636 | 636 | |
| 637 | 637 | case self::PMF_LINK_GET_ACTION_SITEMAP: |
| 638 | 638 | if (isset($getParams[self::PMF_LINK_GET_LETTER])) { |
| 639 | - $url .= self::PMF_LINK_SITEMAP . |
|
| 640 | - $getParams[self::PMF_LINK_GET_LETTER] . |
|
| 641 | - self::PMF_LINK_HTML_SLASH . |
|
| 642 | - $getParams[self::PMF_LINK_GET_LANG] . |
|
| 639 | + $url .= self::PMF_LINK_SITEMAP. |
|
| 640 | + $getParams[self::PMF_LINK_GET_LETTER]. |
|
| 641 | + self::PMF_LINK_HTML_SLASH. |
|
| 642 | + $getParams[self::PMF_LINK_GET_LANG]. |
|
| 643 | 643 | self::PMF_LINK_HTML_EXTENSION; |
| 644 | 644 | } else { |
| 645 | - $url .= self::PMF_LINK_SITEMAP . 'A' . |
|
| 646 | - self::PMF_LINK_HTML_SLASH . |
|
| 647 | - $getParams[self::PMF_LINK_GET_LANG] . |
|
| 645 | + $url .= self::PMF_LINK_SITEMAP.'A'. |
|
| 646 | + self::PMF_LINK_HTML_SLASH. |
|
| 647 | + $getParams[self::PMF_LINK_GET_LANG]. |
|
| 648 | 648 | self::PMF_LINK_HTML_EXTENSION; |
| 649 | 649 | } |
| 650 | 650 | break; |
@@ -655,25 +655,25 @@ discard block |
||
| 655 | 655 | (0 == $getParams[self::PMF_LINK_GET_CATEGORY]))) { |
| 656 | 656 | $url .= self::PMF_LINK_HTML_SHOWCAT; |
| 657 | 657 | } else { |
| 658 | - $url .= self::PMF_LINK_CATEGORY . |
|
| 658 | + $url .= self::PMF_LINK_CATEGORY. |
|
| 659 | 659 | $getParams[self::PMF_LINK_GET_CATEGORY]; |
| 660 | 660 | if (isset($getParams[self::PMF_LINK_GET_PAGE])) { |
| 661 | - $url .= self::PMF_LINK_HTML_SLASH . |
|
| 661 | + $url .= self::PMF_LINK_HTML_SLASH. |
|
| 662 | 662 | $getParams[self::PMF_LINK_GET_PAGE]; |
| 663 | 663 | } |
| 664 | - $url .= self::PMF_LINK_HTML_SLASH . |
|
| 665 | - $this->getSEOItemTitle() . |
|
| 664 | + $url .= self::PMF_LINK_HTML_SLASH. |
|
| 665 | + $this->getSEOItemTitle(). |
|
| 666 | 666 | self::PMF_LINK_HTML_EXTENSION; |
| 667 | 667 | } |
| 668 | 668 | break; |
| 669 | 669 | |
| 670 | 670 | case self::PMF_LINK_GET_ACTION_NEWS: |
| 671 | - $url .= self::PMF_LINK_NEWS . |
|
| 672 | - $getParams[self::PMF_LINK_GET_NEWS_ID] . |
|
| 673 | - self::PMF_LINK_HTML_SLASH . |
|
| 674 | - $getParams[self::PMF_LINK_GET_NEWS_LANG] . |
|
| 675 | - self::PMF_LINK_SLASH . |
|
| 676 | - $this->getSEOItemTitle() . |
|
| 671 | + $url .= self::PMF_LINK_NEWS. |
|
| 672 | + $getParams[self::PMF_LINK_GET_NEWS_ID]. |
|
| 673 | + self::PMF_LINK_HTML_SLASH. |
|
| 674 | + $getParams[self::PMF_LINK_GET_NEWS_LANG]. |
|
| 675 | + self::PMF_LINK_SLASH. |
|
| 676 | + $this->getSEOItemTitle(). |
|
| 677 | 677 | self::PMF_LINK_HTML_EXTENSION; |
| 678 | 678 | break; |
| 679 | 679 | } |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | $url = $this->url; |
| 703 | 703 | if (!empty($this->url)) { |
| 704 | 704 | if ((!$this->hasScheme()) && (!$this->isInternalReference())) { |
| 705 | - $url = $this->getDefaultScheme() . $this->url; |
|
| 705 | + $url = $this->getDefaultScheme().$this->url; |
|
| 706 | 706 | } |
| 707 | 707 | } |
| 708 | 708 | |
@@ -717,9 +717,9 @@ discard block |
||
| 717 | 717 | public function getCurrentUrl() |
| 718 | 718 | { |
| 719 | 719 | if (!empty($_SERVER['HTTPS'])) { |
| 720 | - return 'https://' . $_SERVER['SERVER_NAME'] . PMF_String::htmlentities($_SERVER['REQUEST_URI']); |
|
| 720 | + return 'https://'.$_SERVER['SERVER_NAME'].PMF_String::htmlentities($_SERVER['REQUEST_URI']); |
|
| 721 | 721 | } else { |
| 722 | - return 'http://' . $_SERVER['SERVER_NAME'] . PMF_String::htmlentities($_SERVER['REQUEST_URI']); |
|
| 722 | + return 'http://'.$_SERVER['SERVER_NAME'].PMF_String::htmlentities($_SERVER['REQUEST_URI']); |
|
| 723 | 723 | } |
| 724 | 724 | } |
| 725 | 725 | |
@@ -276,7 +276,7 @@ |
||
| 276 | 276 | * |
| 277 | 277 | * @param string $string String |
| 278 | 278 | * |
| 279 | - * @return mixed false if URL is not found, otherwise returns the number of URLs found. |
|
| 279 | + * @return integer false if URL is not found, otherwise returns the number of URLs found. |
|
| 280 | 280 | */ |
| 281 | 281 | public function parse_string($string = "") |
| 282 | 282 | { |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | // If path is not specified in reference uri, set as blank |
| 259 | 259 | if (isset($pathparts['path'])) { |
| 260 | - $pathparts['path'] = str_replace("\\","/",$pathparts['path']); |
|
| 261 | - $pathparts['path'] = preg_replace("/^.*(\/)$/i","", $pathparts['path']); |
|
| 260 | + $pathparts['path'] = str_replace("\\", "/", $pathparts['path']); |
|
| 261 | + $pathparts['path'] = preg_replace("/^.*(\/)$/i", "", $pathparts['path']); |
|
| 262 | 262 | } else { |
| 263 | 263 | $pathparts['path'] = ""; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | // Recombine urls |
| 267 | - if (PMF_String::substr($relativeuri,0,1) == "/") { |
|
| 267 | + if (PMF_String::substr($relativeuri, 0, 1) == "/") { |
|
| 268 | 268 | return $pathparts['scheme']."://".$pathparts['host'].$pathparts['port'].$relativeuri; |
| 269 | 269 | } else { |
| 270 | 270 | return $pathparts['scheme']."://".$pathparts['host'].$pathparts['port'].$pathparts['path']."/".$relativeuri; |
@@ -286,10 +286,10 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | // Clean $this->urlpool |
| 288 | 288 | $this->urlpool = array(); |
| 289 | - while(list(,$type) = each($types)) { |
|
| 289 | + while (list(,$type) = each($types)) { |
|
| 290 | 290 | preg_match_all("|[^?&]$type\=(\"?'?`?)([[:alnum:]\:\#%?=;&@/\ \.\_\-\{\}]+)\\1|i", $string, $matches); |
| 291 | 291 | $sz = sizeof($matches[2]); |
| 292 | - for ($i = 0;$i < $sz; $i++) { |
|
| 292 | + for ($i = 0; $i < $sz; $i++) { |
|
| 293 | 293 | $this->urlpool[$type][] = $matches[2][$i]; |
| 294 | 294 | $urlcount++; |
| 295 | 295 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | // parse URL |
| 342 | 342 | $urlParts = @parse_url($url); |
| 343 | - foreach(array( |
|
| 343 | + foreach (array( |
|
| 344 | 344 | 'scheme' => 'http', |
| 345 | 345 | 'host' => $_SERVER['HTTP_HOST'], |
| 346 | 346 | 'user' => '', |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | switch ($code) { |
| 460 | 460 | // TODO: Add more explicit http status management |
| 461 | 461 | case '200': // OK |
| 462 | - $_reason = ($redirectCount > 0) ? sprintf($PMF_LANG['ad_linkcheck_openurl_redirected'],PMF_String::htmlspecialchars($url)) : ""; |
|
| 462 | + $_reason = ($redirectCount > 0) ? sprintf($PMF_LANG['ad_linkcheck_openurl_redirected'], PMF_String::htmlspecialchars($url)) : ""; |
|
| 463 | 463 | return array(true, $redirectCount, $_reason); |
| 464 | 464 | break; |
| 465 | 465 | case '301': // Moved Permanently (go recursive ?) |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | $inforeasons[] = sprintf( |
| 775 | 775 | $PMF_LANG['ad_linkcheck_openurl_infoprefix'], |
| 776 | 776 | PMF_String::htmlspecialchars($value['absurl']) |
| 777 | - ) . $value['reason']; |
|
| 777 | + ).$value['reason']; |
|
| 778 | 778 | } |
| 779 | 779 | } else { |
| 780 | 780 | $_classname = "urlfail"; |
@@ -712,15 +712,15 @@ discard block |
||
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | /** |
| 715 | - * Verifies specified article content and update links_state database entry |
|
| 716 | - * |
|
| 717 | - * @param string $contents |
|
| 718 | - * @param integer $id |
|
| 719 | - * @param string $artlang |
|
| 720 | - * @param boolean $cron |
|
| 721 | - * |
|
| 722 | - * @return string HTML text, if $cron is false (default) |
|
| 723 | - */ |
|
| 715 | + * Verifies specified article content and update links_state database entry |
|
| 716 | + * |
|
| 717 | + * @param string $contents |
|
| 718 | + * @param integer $id |
|
| 719 | + * @param string $artlang |
|
| 720 | + * @param boolean $cron |
|
| 721 | + * |
|
| 722 | + * @return string HTML text, if $cron is false (default) |
|
| 723 | + */ |
|
| 724 | 724 | public function verifyArticleURL($contents = '', $id = 0, $artlang = '', $cron = false) |
| 725 | 725 | { |
| 726 | 726 | global $PMF_LANG; |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | $inforeasons[] = sprintf( |
| 775 | 775 | $PMF_LANG['ad_linkcheck_openurl_infoprefix'], |
| 776 | 776 | PMF_String::htmlspecialchars($value['absurl']) |
| 777 | - ) . $value['reason']; |
|
| 777 | + ) . $value['reason']; |
|
| 778 | 778 | } |
| 779 | 779 | } else { |
| 780 | 780 | $_classname = "urlfail"; |