Replace AND and OR in PHP conditions by && and ||

This commit is contained in:
Hypolite Petovan 2017-06-07 22:00:59 -04:00
commit 9c0d2c31e8
83 changed files with 596 additions and 596 deletions

View file

@ -785,7 +785,7 @@ function update_contact_avatar($avatar, $uid, $cid, $force = false) {
$data = array($r[0]["photo"], $r[0]["thumb"], $r[0]["micro"]);
}
if (($r[0]["avatar"] != $avatar) OR $force) {
if (($r[0]["avatar"] != $avatar) || $force) {
$photos = import_profile_photo($avatar, $uid, $cid, true);
if ($photos) {
@ -825,7 +825,7 @@ function import_profile_photo($photo, $uid, $cid, $quit_on_error = false) {
$filename = basename($photo);
$img_str = fetch_url($photo, true);
if ($quit_on_error AND ($img_str == "")) {
if ($quit_on_error && ($img_str == "")) {
return false;
}
@ -883,7 +883,7 @@ function import_profile_photo($photo, $uid, $cid, $quit_on_error = false) {
$photo_failure = true;
}
if ($photo_failure AND $quit_on_error) {
if ($photo_failure && $quit_on_error) {
return false;
}
@ -902,7 +902,7 @@ function get_photo_info($url) {
$data = Cache::get($url);
if (is_null($data) OR !$data OR !is_array($data)) {
if (is_null($data) || !$data || !is_array($data)) {
$img_str = fetch_url($url, true, $redirects, 4);
$filesize = strlen($img_str);
@ -996,7 +996,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
/// $default_cid = $r[0]['id'];
/// $community_page = (($r[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
if ((strlen($imagedata) == 0) AND ($url == "")) {
if ((strlen($imagedata) == 0) && ($url == "")) {
logger("No image data and no url provided", LOGGER_DEBUG);
return(array());
} elseif (strlen($imagedata) == 0) {
@ -1102,7 +1102,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
}
}
if ($width > 160 AND $height > 160) {
if ($width > 160 && $height > 160) {
$x = 0;
$y = 0;