Browse code

version check - removed online path

Jimako authored on 2023/09/05 17:01:49
Showing 1 changed files
... ...
@@ -26,62 +26,17 @@
26 26
 if(!defined("_CHARSET")) exit( );
27 27
 
28 28
 
29
+	$currentversion = "3.5.6";
29 30
 
30 31
 	$output .= "<div id=\"pagetitle\">"._VERSIONCHECK."</div>";
31 32
 
32
-	// make sure curl is installed
33
-	if (function_exists('curl_init')) {
34
-		$output .= write_message(_RUNNINGVERSION);
35
-	   // initialize a new curl resource
36
-	   $ch = curl_init();
33
+ 
34
+	 $output .= write_message(_CURRENTVERSION. "$currentversion");
37 35
 
38
-	   // set the url to fetch
39
-	   curl_setopt($ch, CURLOPT_URL, 'http://www.efiction.org/version.txt');
40
-
41
-	   // don't give me the headers just the content
42
-	   curl_setopt($ch, CURLOPT_HEADER, 0);
43
-
44
-	   // return the value instead of printing the response to browser
45
-	   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
46
-
47
-	   // use a user agent to mimic a browser
48
-	   curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
49
-
50
-	   $content = curl_exec($ch);
51
-	   $currentversion = $content;
52
-				$output .= write_message(_CURRENTVERSION. "$currentversion");
53
-
54
-				if ($currentversion != $version) {
55
-				$output .= write_message (_UPDATEVERSION);
56
-				}
57
-				else $output .= write_message (_UPTODATE);
58
-
59
-	   // remember to always close the session and free all resources
60
-	   curl_close($ch);
61
-	}
62
-
63
-	else if(ini_get("allow_url_fopen")) {
64
-		$output .= write_message(_RUNNINGVERSION);
65
-
66
-		$location = fopen ("http://efiction.org/version.txt", "r");
67
-		$buffer = '';
68
-		while (!feof ($location)) {
69
-			$buffer .= fgets($location, 4096);
70
-		}
71
-		fclose ($location);
72
-
73
-		if ($buffer != '') {
74
-			$currentversion = $buffer;
75
-			$output .= write_message(_CURRENTVERSION. "$currentversion");
76
-
77
-			if ($currentversion != $version) {
78
-			$output .= write_message (_UPDATEVERSION);
79
-			}
80
-			else $output .= write_message (_UPTODATE);
81
-		}
82
-	}
83
-	else {	
84
-		$output .= write_message(_VERSIONNOTALLOWED);
36
+	if ($currentversion != $version) {
37
+	$output .= write_message (_UPDATEVERSION);
85 38
 	}
39
+	else $output .= write_message (_UPTODATE);
40
+ 
86 41
 
87 42
 ?>
88 43
\ No newline at end of file
Browse code

Start Point - version 3.5.5 + fixes

Jimako authored on 2023/09/05 17:01:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,87 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+
30
+	$output .= "<div id=\"pagetitle\">"._VERSIONCHECK."</div>";
31
+
32
+	// make sure curl is installed
33
+	if (function_exists('curl_init')) {
34
+		$output .= write_message(_RUNNINGVERSION);
35
+	   // initialize a new curl resource
36
+	   $ch = curl_init();
37
+
38
+	   // set the url to fetch
39
+	   curl_setopt($ch, CURLOPT_URL, 'http://www.efiction.org/version.txt');
40
+
41
+	   // don't give me the headers just the content
42
+	   curl_setopt($ch, CURLOPT_HEADER, 0);
43
+
44
+	   // return the value instead of printing the response to browser
45
+	   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
46
+
47
+	   // use a user agent to mimic a browser
48
+	   curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
49
+
50
+	   $content = curl_exec($ch);
51
+	   $currentversion = $content;
52
+				$output .= write_message(_CURRENTVERSION. "$currentversion");
53
+
54
+				if ($currentversion != $version) {
55
+				$output .= write_message (_UPDATEVERSION);
56
+				}
57
+				else $output .= write_message (_UPTODATE);
58
+
59
+	   // remember to always close the session and free all resources
60
+	   curl_close($ch);
61
+	}
62
+
63
+	else if(ini_get("allow_url_fopen")) {
64
+		$output .= write_message(_RUNNINGVERSION);
65
+
66
+		$location = fopen ("http://efiction.org/version.txt", "r");
67
+		$buffer = '';
68
+		while (!feof ($location)) {
69
+			$buffer .= fgets($location, 4096);
70
+		}
71
+		fclose ($location);
72
+
73
+		if ($buffer != '') {
74
+			$currentversion = $buffer;
75
+			$output .= write_message(_CURRENTVERSION. "$currentversion");
76
+
77
+			if ($currentversion != $version) {
78
+			$output .= write_message (_UPDATEVERSION);
79
+			}
80
+			else $output .= write_message (_UPTODATE);
81
+		}
82
+	}
83
+	else {	
84
+		$output .= write_message(_VERSIONNOTALLOWED);
85
+	}
86
+
87
+?>
0 88
\ No newline at end of file