From 345b3216c87c7b365916e5948ad3bdb1bb045016 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Wed, 23 May 2012 13:26:34 -0400 Subject: Be consistent in PHP logical operator usage A mix of logical operator styles are currently in use. The predominant style uses "&&" and "||" instead of "and" and "or", respectively. This inconsistency is minor, but is easily avoided. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/html/addvote.php | 2 +- web/html/tu.php | 4 ++-- web/lib/pkgfuncs.inc.php | 4 ++-- web/template/pkg_details.php | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/html/addvote.php b/web/html/addvote.php index f0e7d31a..4b6c5b5e 100644 --- a/web/html/addvote.php +++ b/web/html/addvote.php @@ -13,7 +13,7 @@ if (isset($_COOKIE["AURSID"])) { $atype = ""; } -if ($atype == "Trusted User" OR $atype == "Developer") { +if ($atype == "Trusted User" || $atype == "Developer") { $dbh = db_connect(); if (!empty($_POST['addVote'])) { diff --git a/web/html/tu.php b/web/html/tu.php index 6e043538..9d4fc508 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -19,7 +19,7 @@ if (isset($_COOKIE["AURSID"])) { $atype = account_from_sid($_COOKIE["AURSID"]); } -if ($atype == "Trusted User" OR $atype == "Developer") { +if ($atype == "Trusted User" || $atype == "Developer") { if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { @@ -123,7 +123,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") { else $by = 'desc'; - if (!empty($offset) AND is_numeric($offset)) { + if (!empty($offset) && is_numeric($offset)) { if ($offset >= 1) { $off = $offset; } else { diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 2dcbec8e..d34b415f 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -1105,8 +1105,8 @@ function pkg_change_category($atype, $dbh=NULL) { } $uid = uid_from_sid($_COOKIE["AURSID"], $dbh); - if ($uid == $pkg["MaintainerUID"] or - ($atype == "Developer" or $atype == "Trusted User")) { + if ($uid == $pkg["MaintainerUID"] || + ($atype == "Developer" || $atype == "Trusted User")) { $q = "UPDATE Packages "; $q.= "SET CategoryID = ".intval($category_id)." "; $q.= "WHERE ID = ".intval($pid); diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 230cc2c6..93e0469b 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -9,8 +9,8 @@ else { $pkgid = pkgid_from_name($_REQUEST['N']); } -if ($uid == $row["MaintainerUID"] or - ($atype == "Developer" or $atype == "Trusted User")) { +if ($uid == $row["MaintainerUID"] || + ($atype == "Developer" || $atype == "Trusted User")) { $catarr = pkgCategories(); $edit_cat = "
\n"; @@ -55,7 +55,7 @@ if ($row["MaintainerUID"]) { } $votes = __('Votes') . ': ' . $row['NumVotes']; -if ($atype == "Developer" or $atype == "Trusted User") { +if ($atype == "Developer" || $atype == "Trusted User") { $votes = "$votes"; } -- cgit v1.2.3-24-g4f1b