Mercurial > hg > fapweb
diff msite.inc.php @ 1104:0a2117349f46
s/true/TRUE/g; s/false/FALSE/g;
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 14 May 2019 14:45:36 +0300 |
parents | 95b74632cfe2 |
children | 51f24cb35fc8 |
line wrap: on
line diff
--- a/msite.inc.php Tue May 14 14:12:42 2019 +0300 +++ b/msite.inc.php Tue May 14 14:45:36 2019 +0300 @@ -387,7 +387,7 @@ if (isset($displayVars[$name])) { $displayVars[$name] = $value; - $displayVarsChanged[$name] = true; + $displayVarsChanged[$name] = TRUE; } else die("No display var for '".$name."'.\n"); @@ -658,14 +658,14 @@ else if (strlen($email) > 0) { - if ($id !== false) + if ($id !== FALSE) // By another ID, if we are updating an entry $sql = stPrepareSQL("SELECT * FROM attendees WHERE id<>%d AND email=%s", $id, $email); else // Or just exists, if adding $sql = stPrepareSQL("SELECT * FROM attendees WHERE email=%s", $email); - if (($data = stFetchSQL($sql)) !== false) + if (($data = stFetchSQL($sql)) !== FALSE) { stError("Someone with the same e-mail address is already registered."); $res = FALSE; @@ -675,14 +675,14 @@ // Check if another user already exists if ($chk >= 2) { - if ($id !== false) + if ($id !== FALSE) // By another ID, if we are updating an entry $sql = stPrepareSQL("SELECT * FROM attendees WHERE id<>%d AND name=%s AND groups=%s", $id, $name, $groups); else // Or just exists, if adding $sql = stPrepareSQL("SELECT * FROM attendees WHERE name=%s AND groups=%s", $name, $groups); - if (($data = stFetchSQL($sql)) !== false) + if (($data = stFetchSQL($sql)) !== FALSE) { stError("Someone with the same name and groups is already registered."); $res = FALSE; @@ -770,7 +770,7 @@ $userKeyMode = stGetSetting("userKeyMode"); $out = array(); $sql = "SELECT * FROM compos ".(($flags & RFLAG_HIDDEN_COMPOS) ? "" : "WHERE visible<>0 ")."ORDER BY name DESC"; - if (($res = stExecSQL($sql)) === false) + if (($res = stExecSQL($sql)) === FALSE) return $out; // For each compo that has been set visible @@ -971,7 +971,7 @@ { global $fileTypeData; - if ($compo === false || $entry === false) + if ($compo === FALSE || $entry === FALSE) return FALSE; $previewPath = stGetSetting("previewPath"); @@ -984,7 +984,7 @@ ); if ($entry["preview_id"] != 0 && - ($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry["preview_id"])) !== false) + ($efile = stFetchSQL("SELECT * FROM files WHERE deleted=0 AND id=".$entry["preview_id"])) !== FALSE) { $pdata["file"] = $efile; if (isset($fileTypeData[$efile["filetype"]]["type"])) @@ -992,7 +992,7 @@ } else if ($entry["file_id"] == 0) - $pdata["valid"] = $efile = false; + $pdata["valid"] = $efile = FALSE; switch ($pdata["type"]) { @@ -1090,7 +1090,7 @@ global $fileTypeData; // Get file magic info - if (($finfo = finfo_open()) === false) + if (($finfo = finfo_open()) === FALSE) { stLogError("Internal error. Failed to initialize finfo()."); return stError("Internal error, failed to probe file."); @@ -1144,7 +1144,7 @@ "VALUES (%s,%s,%d,%d,%d,%s,%d)", $origName, $fileType, $fileSize, $entry["id"], $uploaderID, $type, time()); - if (($fileID = stExecSQLInsert($sql)) === false) + if (($fileID = stExecSQLInsert($sql)) === FALSE) return stFileError($uploaderID, "Failed to add new ".$type." file for entry #".$entry["id"]." '".$origName."'.", "Internal error. Failed to add new file."); @@ -1160,20 +1160,20 @@ // Update entry with generated filename $sql = stPrepareSQL("UPDATE files SET filename=%s WHERE id=%d", $fileName, $fileID); - if (stExecSQL($sql) === false) + if (stExecSQL($sql) === FALSE) return stFileError($uploaderID, "Failed to update newly created files entry #".$fileID." with generated filename '".$fileName."'!", "Internal error. Failed to add new file."); // Update entry's reference $sql = stPrepareSQL("UPDATE entries SET ".$field."=%d WHERE id=%d", $fileID, $entry["id"]); - if (stExecSQL($sql) === false) + if (stExecSQL($sql) === FALSE) return stFileError($uploaderID, "Failed to update entry #".$entry["id"]." ".$type." ID!", "Internal error. Failed to add new file."); // Return file entry - if (($res = stFetchSQL("SELECT * FROM files WHERE id=".$fileID)) === false) + if (($res = stFetchSQL("SELECT * FROM files WHERE id=".$fileID)) === FALSE) return stFileError($uploaderID, "Failed to fetch newly generated files entry #".$fileID, "Internal error. Failed to add new file."); @@ -1199,12 +1199,12 @@ return FALSE; // Check entry existence - if (($entry = stFetchSQL("SELECT * FROM entries WHERE id=".$entryID)) === false) + if (($entry = stFetchSQL("SELECT * FROM entries WHERE id=".$entryID)) === FALSE) return stFileError($userID, "Entry ID #".$entryID." does not exist in the entries table?", "Entry does not exist??"); - if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$entry["compo_id"])) === false) + if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$entry["compo_id"])) === FALSE) return stFileError($userID, "Compo ID #".$entry["compo_id"]." in entry ID #".$entryID." does not exist!", "Compo does not exist??"); @@ -1232,7 +1232,7 @@ if ($userID != 0) { // Check if the user even exists, just in case - if (($user = stFetchSQL("SELECT * FROM attendees WHERE id=".$userID)) === false) + if (($user = stFetchSQL("SELECT * FROM attendees WHERE id=".$userID)) === FALSE) return stFileError($userID, "User ID #".$userID." does not exist??", "You do not exist. Go away."); @@ -1292,33 +1292,33 @@ // Check file properties .. - if (($fileInfo = stProbeFileInfo($tmpFilename)) === false) + if (($fileInfo = stProbeFileInfo($tmpFilename)) === FALSE) return FALSE; if ($uploadType == "preview" && !isset($fileInfo["type"])) return stError("Preview file upload is not one of the supported preview file types."); // Get original extension - if (($fileExt = $fileInfo["fext"]) === false) + if (($fileExt = $fileInfo["fext"]) === FALSE) { $fileExt = "bin"; - if (($epos = strrpos($orgFilename, ".")) !== false) + if (($epos = strrpos($orgFilename, ".")) !== FALSE) $fileExt = substr($orgFilename, $epos + 1); } // Update current or add new file entry - if (($fentry = stAddFileEntry($entry, $uploadType, $orgFilename, $fileSize, $fileExt, $fileInfo["id"], $userID)) === false) + if (($fentry = stAddFileEntry($entry, $uploadType, $orgFilename, $fileSize, $fileExt, $fileInfo["id"], $userID)) === FALSE) return FALSE; // Set permissions before moving the file - if (chmod($tmpFilename, stGetSetting($uploadType."PathPerms")) === false) + if (chmod($tmpFilename, stGetSetting($uploadType."PathPerms")) === FALSE) return stFileError($userID, "Could not set permissions for uploaded file '".$tmpFilename."'.", "Internal error. Could not set permissions for uploaded file. Contact site admins."); // Move file to its destination $dstFilename = stMakePath(FALSE, TRUE, array(stGetSetting("entryPath"), $compo["cpath"], $fentry["filename"])); - if (@move_uploaded_file($tmpFilename, $dstFilename) === false) + if (@move_uploaded_file($tmpFilename, $dstFilename) === FALSE) return stFileError($userID, "Could not move uploaded file '".$tmpFilename."' to '".$dstFilename."'.", "Internal error. Deploying uploaded file failed! Contact site admins.");