diff --git a/CHANGELOG b/CHANGELOG index 8fbbeb1..68aa374 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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. diff --git a/database-initial.sql b/database-initial.sql index b20a2a0..7d13769 100644 --- a/database-initial.sql +++ b/database-initial.sql @@ -69,7 +69,7 @@ CREATE TABLE `configs` ( LOCK TABLES `configs` WRITE; /*!40000 ALTER TABLE `configs` DISABLE KEYS */; INSERT INTO `configs` VALUES -(1,'ol_version','5.2.4.1'), +(1,'ol_version','5.2.4.2'), (2,'log_name','OpenLog'), (3,'banner','1'), (4,'background_color','#003333'), diff --git a/database-update.sql b/database-update.sql index 70bf59c..55c79df 100644 --- a/database-update.sql +++ b/database-update.sql @@ -35,3 +35,8 @@ UPDATE configs SET confvalue="5.2.4" WHERE confname="ol_version"; -- Update version number UPDATE configs SET confvalue="5.2.4.1" WHERE confname="ol_version"; -- -------------------------------------- + +-- ---------- version 5.2.4.2 ------------- +-- Update version number +UPDATE configs SET confvalue="5.2.4.2" WHERE confname="ol_version"; +-- -------------------------------------- diff --git a/db.php_update b/db.php_update index b3682d7..c2e8fbc 100644 --- a/db.php_update +++ b/db.php_update @@ -21,3 +21,7 @@ install_path=$1 # ---------- version 5.2.4.1 ------------ # No changes to the db.php file # --------------------------------------- + +# ---------- version 5.2.4.2 ------------ +# No changes to the db.php file +# --------------------------------------- diff --git a/distfiles/CHANGELOG b/distfiles/CHANGELOG index 8fbbeb1..68aa374 100644 --- a/distfiles/CHANGELOG +++ b/distfiles/CHANGELOG @@ -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. diff --git a/distfiles/logentry.php b/distfiles/logentry.php index 3c3bd6e..0347efa 100644 --- a/distfiles/logentry.php +++ b/distfiles/logentry.php @@ -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 diff --git a/distfiles/maintformentry.php b/distfiles/maintformentry.php index d0c6143..395a8e2 100644 --- a/distfiles/maintformentry.php +++ b/distfiles/maintformentry.php @@ -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("%s", $flagcheckbox["flagid"],$flagcheckbox["flagcolor"],$flagcheckbox["flagname"],$flagcheckbox["flagsym"]); diff --git a/distfiles/search.php b/distfiles/search.php index 6b24153..48aaded 100644 --- a/distfiles/search.php +++ b/distfiles/search.php @@ -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 " Search in:   "; + if ($target[0]=="") $target=[]; if (in_array("log", $target)) { echo "Logbook  "; } 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("%s", $flagcheckbox["flagcolor"],$flagcheckbox["flagsym"]); @@ -607,6 +612,7 @@ if (!$print) {

"; if ($doparts) { + if ($target[0]=="") $target=[]; echo " Search in:   "; @@ -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 "No Logbook notes match your search criteria.

"; } } + 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 "No Maintenance Forms match your search criteria.

"; } } + if ($target[0]=="") $target=[]; if (in_array("part",$target)) { // run parts query and show results if(mysqli_num_rows($prowqry)) { diff --git a/install.sh b/install.sh index 82e9816..226e8b3 100755 --- a/install.sh +++ b/install.sh @@ -8,7 +8,7 @@ APP_NAME="OpenLog" DEFAULT_DB_NAME="openlog" -APP_VERSION="5.2.4.1" +APP_VERSION="5.2.4.2" DOC_ROOT="/var/www" INSTALL_LOC="openlog" APACHE_USER="www-data"