Plugin Directory

Changeset 3403771


Ignore:
Timestamp:
11/27/2025 05:06:47 AM (2 months ago)
Author:
scheeeli
Message:
  • Fixed the post_status field on custom post type for scan results and added log of all scan errors to the post_meta.
Location:
gotmls
Files:
4 edited
20 copied

Legend:

Unmodified
Added
Removed
  • gotmls/tags/4.23.85/images/index.php

    r3379118 r3403771  
    33 * GOTMLS Plugin Global Variables and Functions
    44 * @package GOTMLS
    5  * @since 4.23.83
     5 * @since 4.23.85
    66*/
    77
     
    992992            if (1 == $time)
    993993                $unit = substr($unit, 0, -1);
    994             if ($time)
    995                 $GLOBALS["GOTMLS"]["scan"]["title"] .= " ran for $time $unit";
     994            if ($time) {
     995                $issues = "";
     996                if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"])) {
     997                    foreach ($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] as $clas => $found) {
     998                        if ($issues)
     999                            $issues .= " and ";
     1000                        else
     1001                            $issues .= " with ";
     1002                        $issues .= count($found)." $clas";
     1003                    }
     1004                }
     1005                $GLOBALS["GOTMLS"]["scan"]["title"] .= " and finished $issues in $time $unit";
     1006            }
    9961007        } else
    9971008            $GLOBALS["GOTMLS"]["scan"]["title"] .= " was not finished!";
     
    10431054        $values["post_author"] = GOTMLS_get_current_user_id(0);
    10441055        $values["post_modified"] = date("Y-m-d H:i:s", (int) microtime(true));
     1056        $values["post_status"] = 'private';
    10451057        if (!(isset($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["settings"])) && isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]))
    10461058            $GLOBALS["GOTMLS"]["scan"]["log"]["settings"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"];
     
    10551067                $values["post_name"] = $GLOBALS["GOTMLS"]["scan"]["key"];
    10561068                $scan_log["inserted"] = $wpdb->insert($wpdb->posts, $values);
     1069            }
     1070            if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["scan"]["finish"]) && is_numeric($GLOBALS["GOTMLS"]["scan"]["log"]["scan"]["finish"]) && GOTMLS_strlen($scanlog_key = preg_replace('/[^0-9a-f]++]i/', "", $GLOBALS["GOTMLS"]["scan"]["key"])) == 32) {
     1071                if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && count($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && ($gotmls_results_ID = $wpdb->get_var($wpdb->prepare("SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'gotmls_results' AND `post_name` = %s", $scanlog_key)))) {
     1072                    $wpdb->delete($wpdb->postmeta, ["post_id" => $gotmls_results_ID]);
     1073                    foreach ($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] as $clas => $found) {
     1074                        $wpdb->insert($wpdb->postmeta, ["post_id" => $gotmls_results_ID, "meta_key" => $clas, "meta_value" => json_encode($found)]);
     1075                    }
     1076                }
    10571077            }
    10581078        }
     
    15801600    $li_js = "/*-->*"."/";
    15811601    $imageF = explode(".", $imageFile.".");
    1582     if ($className != "scanned")
     1602    if ($className != "scanned") {
    15831603        $li_js .= "\n$className++;\ndivx=document.getElementById('found_$className');\nif (divx) {\n\tvar newli = document.createElement('li');\n\tnewli.innerHTML='<img src=\"".GOTMLS_strip4java(GOTMLS_images_path.$imageFile).'.gif" height=16 width=16 alt="'.$GOTMLS_image_alt[$imageF[0]].'" style="float: left;" id="'.$imageFile."_$fileName64\">".GOTMLS_strip4java($link, true).$fileNameJS.($link?"</a>';\n\tdivx.display='block":"")."';\n\tdivx.appendChild(newli);\n}";
    1584     elseif ($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["scan_depth"] == 1) {
     1604        if (substr($className, 0, 3) != "dir" && substr($className, 0, 4) != "skip") {
     1605            if (!(isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"])))
     1606                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] = array();
     1607            if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"]))
     1608                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"][] = "$fileName";
     1609            else
     1610                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"] = array("$fileName");
     1611        }
     1612    } elseif ($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["scan_depth"] == 1) {
    15851613        if (isset($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]) && count($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]))
    15861614            $text = preg_replace('/[\r\n]/', " ", print_r($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"],1));
  • gotmls/tags/4.23.85/index.php

    r3379118 r3403771  
    1111License: GPLv3 or later
    1212License URI: https://www.gnu.org/licenses/gpl-3.0.html#license-text
    13 Version: 4.23.83
     13Version: 4.23.85
    1414Requires PHP: 5.6
    1515Requires CP: 1.1.1
     
    303303                $mt = array_pop($option_names);
    304304                if (GOTMLS_strlen($mt) && is_numeric($mt)) {
    305                     $insert = array("post_name" => md5($mt), "post_content" => json_encode($GOTMLS_scanlog), "post_author" => GOTMLS_get_current_user_id(0), "post_type" => 'gotmls_results', "post_date_gmt" => date("Y-m-d H:i:s", (int) $mt), "post_parent" => $parent);
     305                    $insert = array("post_name" => md5($mt), "post_content" => json_encode($GOTMLS_scanlog), "post_author" => GOTMLS_get_current_user_id(0), "post_type" => 'gotmls_results', "post_status" => 'private', "post_date_gmt" => date("Y-m-d H:i:s", (int) $mt), "post_parent" => $parent);
    306306                    if (isset($GOTMLS_scanlog["scan"]["type"]) && GOTMLS_strlen($GOTMLS_scanlog["scan"]["type"]))
    307307                        $insert["post_title"] = GOTMLS_sanitize($GOTMLS_scanlog["scan"]["type"]);
     
    344344    if ($prs && is_array($prs) && count($prs)) {
    345345        $scans = 0;
     346        $upDate_status = "";
    346347        $PreScan = '<ul class="GOTMLS-scanlog GOTMLS-sidebar-links">'."\n<li>";
    347348        foreach ($prs as $row) {
    348349            $LastScan .= $PreScan.GOTMLS_sanitize($row["post_title"]);
     350            if ($row["post_status"] == "publish")
     351                $upDate_status = 'private';
    349352            if ($scans)
    350353                $PreScan = '<a href="'.GOTMLS_script_URI.'&GOTMLS_clear_history='.$row["post_name"].'&'.$GOTMLS_nonce.'">[clear history below this entry]</a></li>'."\n<li>";
     
    353356            $scans++;
    354357        }
     358        if ($upDate_status)
     359            $wpdb->update($wpdb->posts, array("post_status" => "$upDate_status"), array("post_type" => 'gotmls_results', "post_status" => 'publish'));
    355360        $LastScan .= '</li></ul>';
    356361    } else
  • gotmls/tags/4.23.85/readme.txt

    r3379118 r3403771  
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html#license-text
    10 Version: 4.23.83
    11 Stable tag: 4.23.83
     10Version: 4.23.85
     11Stable tag: 4.23.85
    1212Requires at least: 3.3
    1313Tested up to: 6.8.3
     
    100100
    101101== Changelog ==
     102
     103= 4.23.85 =
     104* Fixed the post_status field on custom post type for scan results and added log of all scan errors to the post_meta.
    102105
    103106= 4.23.83 =
     
    516519== Upgrade Notice ==
    517520
     521= 4.23.85 =
     522Fixed the post_status field on custom post type for scan results and added log of all scan errors to the post_meta.
     523
    518524= 4.23.83 =
    519525Fixed missing capability check on admin-ajax API, changed URLs for better compatibility with HTTPS and HTTP websites, and checked code for compatibility with WordPress 6.8.3.
  • gotmls/tags/4.23.85/safe-load/trace.php

    r3379118 r3403771  
    55*/
    66
    7 define("GOTMLS_Version", '4.23.83');
     7define("GOTMLS_Version", '4.23.85');
    88define("GOTMLS_SAFELOAD_DIR", dirname(__FILE__)."/");
    99define("GOTMLS_CHMOD_FILE", 0644);
  • gotmls/trunk/images/index.php

    r3379118 r3403771  
    33 * GOTMLS Plugin Global Variables and Functions
    44 * @package GOTMLS
    5  * @since 4.23.83
     5 * @since 4.23.85
    66*/
    77
     
    992992            if (1 == $time)
    993993                $unit = substr($unit, 0, -1);
    994             if ($time)
    995                 $GLOBALS["GOTMLS"]["scan"]["title"] .= " ran for $time $unit";
     994            if ($time) {
     995                $issues = "";
     996                if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"])) {
     997                    foreach ($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] as $clas => $found) {
     998                        if ($issues)
     999                            $issues .= " and ";
     1000                        else
     1001                            $issues .= " with ";
     1002                        $issues .= count($found)." $clas";
     1003                    }
     1004                }
     1005                $GLOBALS["GOTMLS"]["scan"]["title"] .= " and finished $issues in $time $unit";
     1006            }
    9961007        } else
    9971008            $GLOBALS["GOTMLS"]["scan"]["title"] .= " was not finished!";
     
    10431054        $values["post_author"] = GOTMLS_get_current_user_id(0);
    10441055        $values["post_modified"] = date("Y-m-d H:i:s", (int) microtime(true));
     1056        $values["post_status"] = 'private';
    10451057        if (!(isset($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["settings"])) && isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]))
    10461058            $GLOBALS["GOTMLS"]["scan"]["log"]["settings"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"];
     
    10551067                $values["post_name"] = $GLOBALS["GOTMLS"]["scan"]["key"];
    10561068                $scan_log["inserted"] = $wpdb->insert($wpdb->posts, $values);
     1069            }
     1070            if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["scan"]["finish"]) && is_numeric($GLOBALS["GOTMLS"]["scan"]["log"]["scan"]["finish"]) && GOTMLS_strlen($scanlog_key = preg_replace('/[^0-9a-f]++]i/', "", $GLOBALS["GOTMLS"]["scan"]["key"])) == 32) {
     1071                if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && count($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && ($gotmls_results_ID = $wpdb->get_var($wpdb->prepare("SELECT `ID` FROM `$wpdb->posts` WHERE `post_type` = 'gotmls_results' AND `post_name` = %s", $scanlog_key)))) {
     1072                    $wpdb->delete($wpdb->postmeta, ["post_id" => $gotmls_results_ID]);
     1073                    foreach ($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] as $clas => $found) {
     1074                        $wpdb->insert($wpdb->postmeta, ["post_id" => $gotmls_results_ID, "meta_key" => $clas, "meta_value" => json_encode($found)]);
     1075                    }
     1076                }
    10571077            }
    10581078        }
     
    15801600    $li_js = "/*-->*"."/";
    15811601    $imageF = explode(".", $imageFile.".");
    1582     if ($className != "scanned")
     1602    if ($className != "scanned") {
    15831603        $li_js .= "\n$className++;\ndivx=document.getElementById('found_$className');\nif (divx) {\n\tvar newli = document.createElement('li');\n\tnewli.innerHTML='<img src=\"".GOTMLS_strip4java(GOTMLS_images_path.$imageFile).'.gif" height=16 width=16 alt="'.$GOTMLS_image_alt[$imageF[0]].'" style="float: left;" id="'.$imageFile."_$fileName64\">".GOTMLS_strip4java($link, true).$fileNameJS.($link?"</a>';\n\tdivx.display='block":"")."';\n\tdivx.appendChild(newli);\n}";
    1584     elseif ($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["scan_depth"] == 1) {
     1604        if (substr($className, 0, 3) != "dir" && substr($className, 0, 4) != "skip") {
     1605            if (!(isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"])))
     1606                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"] = array();
     1607            if (isset($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"]))
     1608                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"][] = "$fileName";
     1609            else
     1610                $GLOBALS["GOTMLS"]["scan"]["log"]["file_results"]["$className"] = array("$fileName");
     1611        }
     1612    } elseif ($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["scan_depth"] == 1) {
    15851613        if (isset($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]) && count($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"]))
    15861614            $text = preg_replace('/[\r\n]/', " ", print_r($GLOBALS["GOTMLS"]["tmp"]["file_scan"]["errors"],1));
  • gotmls/trunk/index.php

    r3379118 r3403771  
    1111License: GPLv3 or later
    1212License URI: https://www.gnu.org/licenses/gpl-3.0.html#license-text
    13 Version: 4.23.83
     13Version: 4.23.85
    1414Requires PHP: 5.6
    1515Requires CP: 1.1.1
     
    303303                $mt = array_pop($option_names);
    304304                if (GOTMLS_strlen($mt) && is_numeric($mt)) {
    305                     $insert = array("post_name" => md5($mt), "post_content" => json_encode($GOTMLS_scanlog), "post_author" => GOTMLS_get_current_user_id(0), "post_type" => 'gotmls_results', "post_date_gmt" => date("Y-m-d H:i:s", (int) $mt), "post_parent" => $parent);
     305                    $insert = array("post_name" => md5($mt), "post_content" => json_encode($GOTMLS_scanlog), "post_author" => GOTMLS_get_current_user_id(0), "post_type" => 'gotmls_results', "post_status" => 'private', "post_date_gmt" => date("Y-m-d H:i:s", (int) $mt), "post_parent" => $parent);
    306306                    if (isset($GOTMLS_scanlog["scan"]["type"]) && GOTMLS_strlen($GOTMLS_scanlog["scan"]["type"]))
    307307                        $insert["post_title"] = GOTMLS_sanitize($GOTMLS_scanlog["scan"]["type"]);
     
    344344    if ($prs && is_array($prs) && count($prs)) {
    345345        $scans = 0;
     346        $upDate_status = "";
    346347        $PreScan = '<ul class="GOTMLS-scanlog GOTMLS-sidebar-links">'."\n<li>";
    347348        foreach ($prs as $row) {
    348349            $LastScan .= $PreScan.GOTMLS_sanitize($row["post_title"]);
     350            if ($row["post_status"] == "publish")
     351                $upDate_status = 'private';
    349352            if ($scans)
    350353                $PreScan = '<a href="'.GOTMLS_script_URI.'&GOTMLS_clear_history='.$row["post_name"].'&'.$GOTMLS_nonce.'">[clear history below this entry]</a></li>'."\n<li>";
     
    353356            $scans++;
    354357        }
     358        if ($upDate_status)
     359            $wpdb->update($wpdb->posts, array("post_status" => "$upDate_status"), array("post_type" => 'gotmls_results', "post_status" => 'publish'));
    355360        $LastScan .= '</li></ul>';
    356361    } else
  • gotmls/trunk/readme.txt

    r3379118 r3403771  
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html#license-text
    10 Version: 4.23.83
    11 Stable tag: 4.23.83
     10Version: 4.23.85
     11Stable tag: 4.23.85
    1212Requires at least: 3.3
    1313Tested up to: 6.8.3
     
    100100
    101101== Changelog ==
     102
     103= 4.23.85 =
     104* Fixed the post_status field on custom post type for scan results and added log of all scan errors to the post_meta.
    102105
    103106= 4.23.83 =
     
    516519== Upgrade Notice ==
    517520
     521= 4.23.85 =
     522Fixed the post_status field on custom post type for scan results and added log of all scan errors to the post_meta.
     523
    518524= 4.23.83 =
    519525Fixed missing capability check on admin-ajax API, changed URLs for better compatibility with HTTPS and HTTP websites, and checked code for compatibility with WordPress 6.8.3.
  • gotmls/trunk/safe-load/trace.php

    r3379118 r3403771  
    55*/
    66
    7 define("GOTMLS_Version", '4.23.83');
     7define("GOTMLS_Version", '4.23.85');
    88define("GOTMLS_SAFELOAD_DIR", dirname(__FILE__)."/");
    99define("GOTMLS_CHMOD_FILE", 0644);
Note: See TracChangeset for help on using the changeset viewer.