diff --git a/include/class.faq.php b/include/class.faq.php index 3e8bcf7c191d560cb8b9213e1c0a5a14a06a5352..b0fdc4ac2b0890895f0adfa3a3268f5e63531221 100644 --- a/include/class.faq.php +++ b/include/class.faq.php @@ -127,7 +127,7 @@ class FAQ { /* Same as update - but mainly called after one or more setters are changed. */ function apply() { //XXX: set errors and add ->getErrors() & ->getError() - return $this->update($this->ht, $errors); + return $this->update($this->ht, $errors); # nolint } function updateTopics($ids){ diff --git a/include/class.filter.php b/include/class.filter.php index da8e6797df0466cab45781a44d9a842013527bc6..9c3065c10aba5aa1e359e4c36a67e4de83aec9fe 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -156,7 +156,7 @@ class Filter { $rule= array_merge($extra,array('w'=>$what, 'h'=>$how, 'v'=>$val)); $rule['filter_id']=$this->getId(); - return FilterRule::create($rule,$errors); + return FilterRule::create($rule,$errors); # nolint } function removeRule($what, $how, $val) { @@ -420,7 +420,7 @@ class Filter { //Success with update/create...save the rules. We can't recover from any errors at this point. # Don't care about errors stashed in $xerrors - self::save_rules($id,$vars,$xerrors); + self::save_rules($id,$vars,$xerrors); # nolint return true; } diff --git a/include/class.format.php b/include/class.format.php index 45f4301913072fa49d93d7dc3a10019b82536563..f7b624d852b5dda8b6dc2e7eedf20a2ef13de5c3 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -104,7 +104,11 @@ class Format { $text=Format::clickableurls($text); //Wrap long words... - $text=preg_replace_callback('/\w{75,}/',create_function('$matches','return wordwrap($matches[0],70,"\n",true);'),$text); + $text=preg_replace_callback('/\w{75,}/', + create_function( + '$matches', # nolint + 'return wordwrap($matches[0],70,"\n",true);'), # nolint + $text); return nl2br($text); } diff --git a/include/class.mailparse.php b/include/class.mailparse.php index 88648367615c7141e2c87b4534f3df683d4ef081..f56006fa9c1e35c88d67165302a7797f43f562d7 100644 --- a/include/class.mailparse.php +++ b/include/class.mailparse.php @@ -50,8 +50,10 @@ class Mail_Parse { function splitBodyHeader() { - if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s",$this->mime_message, $match)) { - $this->header=$match[1]; + if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", + $this->mime_message, + $match)) { # nolint + $this->header=$match[1]; # nolint } } /** diff --git a/include/class.pagenate.php b/include/class.pagenate.php index b182db517e579a9a7f4921a086e57825cea026a5..baad19b09fc6012fe352b5d7b4da3a251b73ee6f 100644 --- a/include/class.pagenate.php +++ b/include/class.pagenate.php @@ -15,37 +15,37 @@ **********************************************************************/ class PageNate { - var $start; - var $limit; - var $total; - var $page; - var $pages; - + var $start; + var $limit; + var $total; + var $page; + var $pages; + - function PageNate($total,$page,$limit=20,$url='') { - $this->total = intval($total); - $this->limit = max($limit, 1 ); - $this->page = max($page, 1 ); - $this->start = max((($page-1)*$this->limit),0); - $this->pages = ceil( $this->total / $this->limit ); - - if (($this->limit > $this->total) || ($this->page>ceil($this->total/$this->limit))) { - $this->start = 0; - } - if (($this->limit-1)*$this->start > $this->total) { - $this->start -= $this->start % $this->limit; - } - $this->setURL($url); - } - function setURL($url='',$vars=''){ - if($url){ - if(strpos($url,'?')===false) - $url=$url.'?'; - }else{ - $url=THISPAGE.'?'; - } - $this->url=$url.$vars; - } + function PageNate($total,$page,$limit=20,$url='') { + $this->total = intval($total); + $this->limit = max($limit, 1 ); + $this->page = max($page, 1 ); + $this->start = max((($page-1)*$this->limit),0); + $this->pages = ceil( $this->total / $this->limit ); + + if (($this->limit > $this->total) || ($this->page>ceil($this->total/$this->limit))) { + $this->start = 0; + } + if (($this->limit-1)*$this->start > $this->total) { + $this->start -= $this->start % $this->limit; + } + $this->setURL($url); + } + function setURL($url='',$vars=''){ + if($url){ + if(strpos($url,'?')===false) + $url=$url.'?'; + }else{ + $url=THISPAGE.'?'; + } + $this->url=$url.$vars; + } function getStart() { return $this->start; @@ -64,34 +64,34 @@ class PageNate { return ceil(($this->start+1)/$this->limit); } - function showing() { - $html = ''; - $from= $this->start+1; - if ($this->start + $this->limit < $this->total) { - $to= $this->start + $this->limit; - } else { - $to= $this->total; - } + function showing() { + $html = ''; + $from= $this->start+1; + if ($this->start + $this->limit < $this->total) { + $to= $this->start + $this->limit; + } else { + $to= $this->total; + } $html=" Showing "; - if ($this->total > 0) { + if ($this->total > 0) { $html .= "$from - $to of " .$this->total; - }else{ - $html .= " 0 "; - } - return $html; - } + }else{ + $html .= " 0 "; + } + return $html; + } - function getPageLinks() { - $html = ''; - $file =$this->url; - $displayed_span = 5; - $total_pages = ceil( $this->total / $this->limit ); - $this_page = ceil( ($this->start+1) / $this->limit ); + function getPageLinks() { + $html = ''; + $file =$this->url; + $displayed_span = 5; + $total_pages = ceil( $this->total / $this->limit ); + $this_page = ceil( ($this->start+1) / $this->limit ); $last=$this_page-1; $next=$this_page+1; - $start_loop = floor($this_page-$displayed_span); + $start_loop = floor($this_page-$displayed_span); $stop_loop = ceil($this_page + $displayed_span); @@ -107,14 +107,14 @@ class PageNate { $html .= "\n<a href=\"$file&p=$lastspan\" ><strong>«</strong></a>"; } - for ($i=$start_loop; $i <= $stop_loop; $i++) { - $page = ($i - 1) * $this->limit; - if ($i == $this_page) { - $html .= "\n<b>[$i]</b>"; - } else { - $html .= "\n<a href=\"$file&p=$i\" ><b>$i</b></a>"; - } - } + for ($i=$start_loop; $i <= $stop_loop; $i++) { + $page = ($i - 1) * $this->limit; + if ($i == $this_page) { + $html .= "\n<b>[$i]</b>"; + } else { + $html .= "\n<a href=\"$file&p=$i\" ><b>$i</b></a>"; + } + } if($stop_loop<$total_pages){ $nextspan=($stop_loop+$displayed_span>$total_pages)?$total_pages-$displayed_span:$stop_loop+$displayed_span; $html .= "\n<a href=\"$file&p=$nextspan\" ><strong>»</strong></a>"; @@ -122,8 +122,8 @@ class PageNate { - return $html; - } + return $html; + } } ?> diff --git a/include/class.validator.php b/include/class.validator.php index ea2dc62d0e079513940885b8f1734c4025bb178f..d41bf027fe826c855893146dfee680c578598feb 100644 --- a/include/class.validator.php +++ b/include/class.validator.php @@ -147,20 +147,21 @@ class Validator { $urlregex = "^(https?)\:\/\/"; // USER AND PASS (optional) - $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?"; + $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)?"; # nolint // HOSTNAME OR IP - $urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; // http://x = allowed (ex. http://localhost, http://routerlogin) + // http://x = allowed (ex. http://localhost, http://routerlogin) + $urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; # nolint //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)+"; // http://x.x = minimum //$urlregex .= "([a-z0-9+\$_-]+\.)*[a-z0-9+\$_-]{2,3}"; // http://x.xx(x) = minimum //use only one of the above // PORT (optional) $urlregex .= "(\:[0-9]{2,5})?"; // PATH (optional) - $urlregex .= "(\/([a-z0-9+\$_-]\.?)+)*\/?"; + $urlregex .= "(\/([a-z0-9+\$_-]\.?)+)*\/?"; # nolint // GET Query (optional) - $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?"; + $urlregex .= "(\?[a-z+&\$_.-][a-z0-9;:@/&%=+\$_.-]*)?"; # nolint // ANCHOR (optional) - $urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?\$"; + $urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?\$"; # nolint return eregi($urlregex, $url)?true:false; } diff --git a/include/mysql.php b/include/mysql.php index 4f50ee6d2cc49d08eabc98a38584048d8c57661b..47f5ab5c8854e7ce4f6cdea47cd5ebd7dccd2fc4 100644 --- a/include/mysql.php +++ b/include/mysql.php @@ -47,8 +47,9 @@ $version=0; if(preg_match('/(\d{1,2}\.\d{1,2}\.\d{1,2})/', - mysql_result(db_query('SELECT VERSION()'),0,0),$matches)) - $version=$matches[1]; + mysql_result(db_query('SELECT VERSION()'),0,0), + $matches)) # nolint + $version=$matches[1]; # nolint return $version; }