$FQFN = str_replace("//", "/", constant('PATH') . $dir. "/". $d);
// Does it match what we are looking for? (We skip a lot files already!)
- if (!preg_match('@(\.|\.\.|\.revision|\.svn|debug\.log|\.cache)$@', $d)) { // no . or .. or .revision or .svn in the filename
+ if (!preg_match('@(\.|\.\.|\.revision|\.svn|debug\.log|\.cache|config\.php)$@', $d)) { // no ., .., .revision, .svn, debug.log or .cache in the filename
+
// Is it a file and readable?
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />\n";
if (isDirectory($FQFN)) {
if (isset($t[2])) $akt_vers[$search] = trim($t[2]);
} // END - foreach
+ // Save the last-changed filename for debugging
+ $akt_vers['File'] = $last_changed['path_name'];
+
// at least 3 keyword-Tags are needed for propper values
- if ($res && $res >= 3) {
+ if ($res && $res >= 3
+ && isset($akt_vers['Revision']) && $akt_vers['Revision'] != ''
+ && isset($akt_vers['Date']) && $akt_vers['Date'] != ''
+ && isset($akt_vers['Tag']) && $akt_vers['Tag'] != '') {
// Prepare content witch need special treadment
// Prepare timestamp for date
if ((isset($akt_vers['Author'])) && ($akt_vers['Author'] != "quix0r")) {
$akt_vers['Tag'] .= '-'.strtoupper($akt_vers['Author']);
} // END - if
+
} else {
// No valid Data from the last modificated file so read the Revision from the Server. Fallback-solution!! Should not be removed I think.
$version = GET_URL("check-updates3.php");
return $translated;
}
+// Determines the real remote address
+function determineRealRemoteAddress () {
+ // Is a proxy in use?
+ if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){
+ // Proxy was used
+ $address = $_SERVER['HTTP_X_FORWARDED_FOR'];
+ } elseif (isset($_SERVER['HTTP_CLIENT_IP'])){
+ // Yet, another proxy
+ $address = $_SERVER['HTTP_CLIENT_IP'];
+ } else {
+ // The regular address when no proxy was used
+ $address = $_SERVER['REMOTE_ADDR'];
+ }
+
+ // This strips out the real address from proxy output
+ if (strstr($address, ",")){
+ $addressArray = explode(",", $address);
+ $address = $addressArray[0];
+ } // END - if
+
+ // Return the result
+ return $address;
+}
+
// "Getter" for remote IP number
function GET_REMOTE_ADDR () {
// Get remote ip from environment
- $remoteAddr = getenv('REMOTE_ADDR');
+ $remoteAddr = determineRealRemoteAddress();
// Is removeip installed?
if (EXT_IS_ACTIVE("removeip")) {