forked from browser-update/browser-update
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-browser2.php
358 lines (320 loc) · 12.1 KB
/
update-browser2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?php
$slimmed=true;
$extratranslation=true;
require_once("lib/init.php");
require_once("lib/lang.php");
$choiceversion="base";
$force_outdated=filter_input(INPUT_GET, 'force_outdated');
$full_locale=get_full_locale();
if (isset($_GET['lang'])) {
$ll = $_GET['lang'];
}
else {
$ll = get_lang();
}
//language for IE/Safari download link: Full locale form. e.g. en-GB
if(strlen($full_locale)!=5) {
$full_locale=$detected_lang;
}
$full_locale_minus=str_replace("_","-",$full_locale);
include("header.php");
function has($t) {
global $ua_;
return !(strpos($ua_,$t)===false);
}
$bx_=get_browserx($ua_);
$browid=$bx_[0];
$brown=$bx_[1];
$browver=$bx_[2];
function is($name) {
global $brown;
if ($brown==$name)
return True;
return False;
}
$sysx=get_system($ua_);
$sys=$sysx[0];
$ver=$sysx[1];
$sysn=$sysx[2];
$u_ff="https://www.mozilla.com/firefox/";
$u_op="https://www.opera.com/";
$u_ch="https://www.google.com/chrome/browser/desktop/";
$u_ie=sprintf("https://www.microsoft.com/%s/windows/microsoft-edge",$full_locale_minus);
function brow($name, $url, $vendor, $char, $na=False,$add="",$add2="") {
global $choiceversion,$ll;
echo '<td class="b b'.$char.'">';
if (!$na) {
echo '<a class="l" href="'.$url.'" target="_blank" rel="noopener" title="'.sprintf(T_("Download updated %s web browser from %s website!"),$name,$vendor).'" onmousedown="countBrowser(\''.$char.'\')">';
}
else {
echo' <a class="l notavailable">';
}
echo '<span class="bro">'.$name.'</span>';
echo '<span class="vendor">'.$vendor.'</span>';
if ($na) {
echo '
<span class="na">'. T_('Most recent version not available for your system.').' '.
T_('Please choose another browser.').'</span>';
}
echo $add;
/*
if (!$na && $ll="en" && dice(10)) {
$choiceversion="down";
echo '<span class="download" style="border-radius: 2px; background-color: rgb(69,190,98); padding: 4px; color: #fff; text-decoration: none; font-size: 13px;">Download</span><style>a .vendor {margin-bottom: 6px;}</style>';
}
*/
echo '
</a>'.$add2.'
</td>
';
}
if (False) {
echo T_("Checking if your browser is up-to-date ..."); //Just for the translation right now
//How can I update?
}
function m_ancient_os($system_name, $os_update_url="") {
echo '<h2 class="whatnow"><b>';
echo T_('Your browser is out-of-date.');
echo '<br/>';
echo sprintf(T_('On top of that your operating system (%s) is so old and unsecure that there is no up-to-date browser available anymore.'),$system_name);
echo '<br/>';
echo sprintf(T_('Please try to <a href="%s">update %s</a> to get the latest version of your browser.'),$os_update_url.'" onmousedown="countBrowser(\'os\')',$system_name);
echo '</b></h2>';
}
function m_discontinued() {
global $sysn,$brown;
echo '<h2 class="whatnow"><b>';
//echo T_('Your browser is out-of-date.');
echo sprintf(T_('Your browser, %s, is out-of-date and it is not updated anymore for %s.'),
'<span class="curb">'.$brown.'</span>',
$sysn
);
echo '<br/>';
echo T_('Please download one of these up-to-date, free and excellent browsers:');
//echo T_('Please download one of these alternative up-to-date, free and excellent browsers, which are even better:');
echo '</b></h2>';
}
function m_uptodate() {
echo '<h2 class="whatnow"><b>';
echo T_('Your browser is up-to-date.');
echo '</b></h2>';
}
function m_outofdate() {
echo '<h2 class="whatnow"><b>';
echo T_('Your browser is out-of-date.');
echo '<br/>';
echo T_('Please download one of these up-to-date, free and excellent browsers:');
echo '</b></h2>';
}
function start_browserlist() {
echo '<table class="logos" id="browserlist"> <tr>';
}
function end_browserlist() {
echo '</tr></table>';
}
if (isset($_GET['emulate']) || $force_outdated) {
include("update.testing.php");
}
?>
<div class="noti">
<?php
if (!is_outdated() and !$force_outdated) {
m_uptodate();
$choiceversion="uptod";
} else {
if ($sys=="Windows") {
// 5->2000/5.x=>xp/2003 6.0->vista, 6.1->win7, 6.2->win8, 6.3->win 8.1
if ($ver<5.1 || $ver>90) {#before xp
$choiceversion="osup";
$u_upwin=sprintf("https://support.microsoft.com/%s/help/14223/windows-xp-end-of-support",$full_locale_minus);
m_ancient_os("Windows",$u_upwin);
}
else if ($ver<=6) {#xp,vista
if (is("Chrome")|| is("Internet Explorer")||is("Opera"))
m_discontinued();
else
m_outofdate();
start_browserlist();
brow("Firefox",$u_ff,"Mozilla Foundation","f");
if (is("Chrome"))
brow("Chrome",$u_ch,"Google","c",True);
if (is("Internet Explorer"))
brow("Edge",$u_ie,"Microsoft","i",True);
if (is("Opera"))
brow("Opera",$u_op,"Opera Software","o",True);
end_browserlist();
}
else {# 7 and above
if (is("Internet Explorer") && $ver<10)
m_discontinued();
else
m_outofdate();
start_browserlist();
brow("Firefox",$u_ff,"Mozilla Foundation","f");
brow("Opera",$u_op,"Opera Software","o");
brow("Chrome",$u_ch,"Google","c");
if (is("Internet Explorer"))
brow("Edge",$u_ie,"Microsoft","i",$ver<10);
end_browserlist();
}
}
if ($sys=="MacOS") {
if ($ver<9) {
if ($ll=="en")
$u_mac="http://www.apple.com/macos/how-to-upgrade/";
else
$u_mac=sprintf("http://www.apple.com/%s/macos/how-to-upgrade/",$county);
$choiceversion="osup";
m_ancient_os("Mac OS", $u_mac);
}
else {
m_outofdate();
}
start_browserlist();
$u_sa=sprintf("https://support.apple.com/%s/HT204416",strtolower($full_locale_minus));
brow("Firefox",$u_ff,"Mozilla Foundation","f",$ver<9);
brow("Opera",$u_op,"Opera Software","o",$ver<9);
brow("Chrome",$u_ch,"Google","c",$ver<9);
brow("Safari",$u_sa,"Apple","s",$ver<10);
end_browserlist();
}
if ($sys=="Android") {
$u_ff="https://play.google.com/store/apps/details?id=org.mozilla.firefox";
$u_op="https://play.google.com/store/apps/details?id=com.opera.browser";
$u_ch="https://play.google.com/store/apps/details?id=com.android.chrome";
if ($ver<1)#old firefox did not give a version info
$ver="4.1";
if ($ver<4.0) {
$choiceversion="osup";
m_ancient_os("Android");
}
else {
if (is("Android Browser"))
m_discontinued();
else
m_outofdate();
start_browserlist();
brow("Firefox",$u_ff,"Mozilla Foundation","f");
brow("Opera",$u_op,"Opera Software","o",$ver<4.1);
brow("Chrome",$u_ch,"Google","c",$ver<4.1);
end_browserlist();
}
}
if ($sys=="Windows Phone") {
$choiceversion="osup";
$url=sprintf("https://support.microsoft.com/%s/help/12662/windows-phone-update-your-windows-phone",strtolower($full_locale_minus));
echo sprintf(T_('On %s the built-in browser can only be updated together with the operating system.'),"Windows Phone");
echo sprintf(T_('Please try to <a href="%s">update %s</a> to get the latest version of your browser.'),"Windows Phone",$url);
//echo T_("Or download this alternative browsers:");
start_browserlist();
brow("Opera Mini","http://www.opera.com/mobile/mini/windows","Opera Software","o");
end_browserlist();
}
if ($sys=="Ubuntu"||$sys=="Linux") {
m_outofdate();
start_browserlist();
brow("Firefox",$u_ff,"Mozilla Foundation","f");
brow("Chrome",$u_ch,"Google","c");
brow("Opera",$u_op,"Opera Software","o");
//brow("Chromium",,"Open Source","cm");
//brow("Pale Moon","http://linux.palemoon.org/","Open Source","pa");
end_browserlist();
}
if ($sys=="iOS") {
$url=sprintf("https://support.apple.com/%s/HT204204",strtolower($full_locale_minus));
echo '<h2 class="whatnow"><b>'.T_('Your browser is out-of-date.')."</b></h2>";
echo '<h2>'.sprintf(T_('On %s the built-in browser can only be updated together with the operating system.'),"iPads and iPhones").'</h2>';
echo '<h2>';
if ($ver<=6) {
$choiceversion="osna";
echo sprintf(T_("Unfortunately, %s has stopped supporting your device with updates."),"Apple");
}
else {
$choiceversion="osup";
echo sprintf(T_('Please try to <a href="%s">update %s</a> to get the latest version of your browser.'),$url.'" onmousedown="countBrowser(\'os\')',"iOS");
}
}
?>
<h2 class="whatnow">
<?php echo sprintf(T_('For more <a href="%s">security</a>, <a href="%s">speed</a>, <a href="%s">comfort</a> and <a href="%s">fun</a>.'),'#security','#speed','#comfort','#fun');?>
</h2>
<?php
/*
display_browser("Yandex Browser", "https://browser.yandex.com",)
display_browser("Seamonkey", "http://www.seamonkey-project.org/releases/#2.33")
display_browser("Maxthon", "http://maxthon.com")
display_browser("Vivaldi", "https://vivaldi.com/")
*/
}
?>
</div>
<?php
include("ads.php");
if (false) {
//for translations
T_("Advertisement");
T_("Sponsored");
T_('<b>Your web browser ({brow_name}) is out-of-date</b>. Update your browser for more security, comfort and the best experience on this site. <a{up_but}>Update browser</a> <a{ignore_but}>Ignore</a>');
}
?>
<div>
<h2><?php echo T_('Why do I need an up-to-date browser?'); ?></h2>
<div id="advc">
<ul class="advantages">
<li class="security" id="security">
<h3><?php echo T_('Security'); ?></h3>
<div><?php echo T_('Newer browsers protect you better against viruses, scams and other threats. Outdated browsers have security holes which are fixed in updates.')?></div>
</li>
<li class="speed" id="speed">
<h3><?php echo T_('Speed'); ?></h3>
<div><?php echo T_('Every new browser generation improves speed')?></div>
</li>
<li class="compatibility" id="fun">
<h3><?php echo T_('Compatibility & new Technology')?></h3>
<div><?php echo T_('You can view sites that are using the latest technology')?></div>
</li>
<li class="comfort" id="comfort">
<h3><?php echo T_('Comfort & better experience')?></h3>
<div><?php echo T_('Have a more comfortable experience with new features, extensions and better customisability.')?></div>
</li>
</ul>
</div>
<div>
<h2><?php echo T_('Why this website?')?></h2>
<p>
<?php echo T_('This is an initiative by websites and blogs to raise security awareness and bring forward the web.'); ?>
<a href="./"><?php echo T_('About the Project')?></a>
</p>
</div>
<h2><?php echo T_('I can\'t update my browser')?></h2>
<ul>
<li><?php echo T_('If you can\'t change your browser because of compatibility issues, think about installing a second browser for browsing and keep the old one for compatibility.'); ?></li>
<li><?php echo T_('Ask your admin to update your browser if you cannot install updates yourself.')?></li>
<?php
if ($ll=="en") {
?>
<li>Consider <a href="http://portableapps.com/apps/internet" target="_blank" rel="noopener" title="install portable browser" onmousedown="countBrowser('port')">installing a portable version of the browser</a></li>
<?php
include("update.feedback.php");
}
?>
</ul>
<?php
if ($ll=="en") {
include("update.moreinfo.php");
}
?>
</div>
<script>
var $buoop = {nomessage:true};
</script>
<script src="/update.min.js"></script>
<script>
var cv="<?php echo $choiceversion;?>";
var second=false;
countView();
</script>
<div class="cookiebar" id="cookiebar"><?php echo T_('This website uses cookies')?> <a onclick="document.getElementById('cookiebar').style.display='none'"><?php echo T_('Close'); ?></a></div>
<?php
include("footer.php");
?>