Incorporate changes made for old version 5.2.4.2

This commit is contained in:
2026-02-10 15:01:54 -05:00
parent 3a0cf99432
commit 6b720a6163
9 changed files with 45 additions and 16 deletions

View File

@@ -207,3 +207,7 @@
any results. This was due to a php fatal error caused by passing
a non-array as the second argument of the php in_array()
function.
5.2.4.2 - 2025-12-11
- Fixed other bugs caused by passing a non-array as the second
argument of the php in_array() function in various files.

View File

@@ -249,6 +249,7 @@ if ($add) {
$flagids=mysqli_query($db,"select flagid from flags");
while ($thisflagid=mysqli_fetch_row($flagids)) {
$thisflag_tbl="flag_".$thisflagid[0];
if ($flags[0]=="") $flags=[];
if (in_array($thisflagid[0],$flags)) {
if(!mysqli_num_rows(mysqli_query($db,"select id from $thisflag_tbl where target=\"notetemplates\" and id=\"$templateid\""))) {
mysqli_query($db,"insert into $thisflag_tbl(target,id) values(\"notetemplates\",\"$templateid\")");
@@ -368,6 +369,7 @@ if ($edit) {
$chainmembers=generate_chain($noteid);
while ($thisflagid=mysqli_fetch_row($flagids)) {
$thisflag_tbl="flag_".$thisflagid[0];
if ($flags[0]=="") $flags=[];
if (in_array($thisflagid[0],$flags)) {
if(!mysqli_num_rows(mysqli_query($db,"select id from $thisflag_tbl where target=\"lognotes\" and id=\"$noteid\""))) {
// set flag for this noteid

View File

@@ -146,10 +146,8 @@ if ($mfadd) {
}
// remove cruft from malfunction text
$mfmalfunction=htmlentities($mfmalfunction);
if (!get_magic_quotes_gpc()) {
$mfmalfunction=addslashes($mfmalfunction);
}
$mfmalfunction=addslashes($mfmalfunction);
if ($mfauthorized) {
$partdatainput=array();
if ($uid) $partdatainput['uid']=$uid;
@@ -170,6 +168,8 @@ if ($mfadd) {
if ($uid =="" || $partnum == "" || $sernum == "") {
// have the maintenance form stay pending due to incomplete part data
$pending=1;
} else {
$pending=0;
}
// add the record to maintforms
@@ -195,13 +195,14 @@ if ($mfedit) {
if ($mfmalfunction && ($uid || ($partnum && $sernum))) {
// remove cruft from malfunction text
$mfmalfunction=htmlentities($mfmalfunction);
if (!get_magic_quotes_gpc()) {
$mfmalfunction=addslashes($mfmalfunction);
}
$mfmalfunction=addslashes($mfmalfunction);
// update parts table
if ($uid =="" || $partnum == "" || $sernum == "") {
// have the maintenance form stay pending due to incomplete part data
$pending=1;
} else {
$pending=0;
}
if (! $pdatamismatch) {
mysqli_query($db,"update parts set uid=\"$uid\", partnum=\"$partnum\", sernum=\"$sernum\", partname=\"$partname\" where partid=\"$mfpart\"");
@@ -215,6 +216,7 @@ if ($mfedit) {
$flagids=mysqli_query($db,"select flagid from flags");
while ($thisflagid=mysqli_fetch_row($flagids)) {
$thisflag_tbl="flag_".$thisflagid[0];
if ($flags[0]=="") $flags=[];
if (in_array($thisflagid[0],$flags)) {
if(!mysqli_num_rows(mysqli_query($db,"select id from $thisflag_tbl where target=\"maintforms\" and id=\"$maintformid\""))) {
mysqli_query($db,"insert into $thisflag_tbl(target,id) values(\"maintforms\",\"$maintformid\")");
@@ -256,10 +258,8 @@ if ($actionadd) {
}
// remove cruft from action text
$action=htmlentities($action);
if (!get_magic_quotes_gpc()) {
$action=addslashes($action);
}
$action=addslashes($action);
// add to maintactions table
mysqli_query($db,"insert into maintactions (actiondate,actiontime,maintformnum,actiontech,action)
values (\"$actiondate\",\"$actiontime\",\"$maintformid\",\"$loggedinas\",\"$action\")");
@@ -273,9 +273,8 @@ if ($actionedit) {
// update the action
// remove cruft from action text
$action=htmlentities($action);
if (!get_magic_quotes_gpc()) {
$action=addslashes($action);
}
$action=addslashes($action);
// update maintactions table
mysqli_query($db,"update maintactions set actiondate=\"$actiondate\", actiontime=\"$actiontime\", action=\"$action\" where maintactionid=\"$maintactionid\"");
}
@@ -399,6 +398,7 @@ if ($printfmt) {
}
$flagslist=mysqli_query($db,"select * from flags");
while ($flagsymbol=mysqli_fetch_assoc($flagslist)) {
if ($theseflags[0]=="") $theseflags=[];
if (in_array($flagsymbol["flagid"],$theseflags)) {
echo $flagsymbol['flagsym']."  ";
}
@@ -491,6 +491,7 @@ if ($printfmt) {
$flagsperline=8;
$flagcount=1;
while ($flagcheckbox=mysqli_fetch_assoc($flagslist)) {
if ($theseflags[0]=="") $theseflags=[];
if (in_array($flagcheckbox["flagid"],$theseflags)) {
printf("<input type=\"checkbox\" name=\"flags[]\" value=\"%s\" checked><font color=\"%s\" title=\"%s\">%s</font>",
$flagcheckbox["flagid"],$flagcheckbox["flagcolor"],$flagcheckbox["flagname"],$flagcheckbox["flagsym"]);

View File

@@ -84,6 +84,7 @@ if ($search) {
$srchpname=trim($srchpname);
$srchploc=trim($srchploc);
$srchnha=trim($srchnha);
if ($target[0]=="") $target=[];
if (in_array("log",$target)) {
// define the query constraints
// log note id
@@ -188,6 +189,7 @@ if ($search) {
$logwhereclause=implode(" and ",$logconstraints);
$logrowqry=mysqli_query($db,"select lognotes.* from $logfromclause where $logwhereclause order by lognotes.date asc, lognotes.time asc");
}
if ($target[0]=="") $target=[];
if (in_array("maintform",$target)) {
// maintforms search
// define the query constraints
@@ -284,6 +286,7 @@ if ($search) {
$mfwhereclause=implode(" and ",$mfconstraints);
$mfrowqry=mysqli_query($db,"select maintforms.* from $mffromclause where $mfwhereclause order by maintforms.mfdate asc, maintforms.mftime asc");
}
if ($target[0]=="") $target=[];
if (in_array("part",$target)) {
// parts search
// define the query constraints
@@ -491,6 +494,7 @@ if (!$print) {
echo "
<b>Search in:</b>&nbsp;&nbsp;
";
if ($target[0]=="") $target=[];
if (in_array("log", $target)) {
echo "<input type=\"checkbox\" name=\"target[]\" value=\"log\" title=\"Search in Logbook\" checked>Logbook&nbsp;&nbsp;";
} else {
@@ -590,6 +594,7 @@ if (!$print) {
$flagcount=1;
while ($flagcheckbox=mysqli_fetch_assoc($flagslist)) {
if ($srchflags) {
if ($srchflags[0]=="") $srchflags=[];
if (in_array($flagcheckbox["flagid"],$srchflags)) {
printf("<font color=\"%s\">%s</font>",
$flagcheckbox["flagcolor"],$flagcheckbox["flagsym"]);
@@ -607,6 +612,7 @@ if (!$print) {
<br><br>
";
if ($doparts) {
if ($target[0]=="") $target=[];
echo "
<b>Search in:</b>&nbsp;&nbsp;
";
@@ -629,6 +635,7 @@ if (!$print) {
}
if ($search) {
if ($target[0]=="") $target=[];
if (in_array("log",$target)) {
// run lognotes query and show results
if(mysqli_num_rows($logrowqry)) {
@@ -686,6 +693,7 @@ if ($search) {
echo "<font size=\"+1\">No Logbook notes match your search criteria.</font><br><hr>";
}
}
if ($target[0]=="") $target=[];
if (in_array("maintform",$target)) {
// run maintforms query and show results
if(mysqli_num_rows($mfrowqry)) {
@@ -748,6 +756,7 @@ if ($search) {
echo "<font size=\"+1\">No Maintenance Forms match your search criteria.</font><br><hr>";
}
}
if ($target[0]=="") $target=[];
if (in_array("part",$target)) {
// run parts query and show results
if(mysqli_num_rows($prowqry)) {