"._VERSIONCHECK.""; $url = 'http://cwcyrix.nsupdate.info/_ef3m/version.txt'; // make sure curl is installed if (function_exists('curl_init')) { $output .= write_message(_RUNNINGVERSION); // initialize a new curl resource $ch = curl_init(); // set the url to fetch curl_setopt($ch, CURLOPT_URL, "$url"); // don't give me the headers just the content curl_setopt($ch, CURLOPT_HEADER, 0); // return the value instead of printing the response to browser curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // use a user agent to mimic a browser curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:156.0) Gecko/20100101 Firefox/156.0'); $content = curl_exec($ch); $currentversion = trim($content); $curlength = strlen($currentversion); if($curlength < 3 || $curlength > 7) { errorVer(); } else $output .= write_message(_CURRENTVERSION. "$currentversion" ."."); if ($currentversion != $version) { $output .= write_message (_UPDATEVERSION); $output .= write_message ("https://github.com/AmiSapphire/efiction3-mod/tags/".$currentversion.""); } else $output .= write_message (_UPTODATE); // remember to always close the session and free all resources // deprecated in PHP 8.5.0, does nothing since PHP 8.0.0 // bugged? - https://www.php.net/manual/en/function.curl-close.php#128829 if (version_compare(PHP_VERSION, '7.3.33', '<=')) { curl_close($ch); } else curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE); } else if(ini_get("allow_url_fopen")) { $output .= write_message(_RUNNINGVERSION); $location = fopen ("$url", "r"); $buffer = ''; while (!feof ($location)) { $buffer .= fgets($location, 4096); } fclose ($location); if ($buffer != '') { $currentversion = trim($buffer); $curlength = strlen($currentversion); if($curlength < 3 || $curlength > 7) { errorVer(); } else $output .= write_message(_CURRENTVERSION. "$currentversion" ."."); if ($currentversion != $version) { $output .= write_message (_UPDATEVERSION); $output .= write_message ("https://github.com/AmiSapphire/efiction3-mod/tags/".$currentversion.""); } else $output .= write_message (_UPTODATE); } } else { $output .= write_message(_VERSIONNOTALLOWED); } function errorVer(){ global $tpl,$output; $output .= write_error("