Subversion Repositories oidplus

Rev

Rev 1149 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1149 Rev 1182
Line 38... Line 38...
38
 
38
 
39
const POLYFILL_CACHE_MAX_AGE = 24 * 60 * 60; // 1 day, TODO: put into baseconfig?
39
const POLYFILL_CACHE_MAX_AGE = 24 * 60 * 60; // 1 day, TODO: put into baseconfig?
40
 
40
 
41
# ---
41
# ---
42
 
42
 
43
require_once __DIR__ . '/includes/functions.inc.php';
43
require_once __DIR__ . '/includes/oidplus.inc.php';
44
 
44
 
45
error_reporting(0);
45
error_reporting(0);
46
 
46
 
47
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
47
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
48
        $out = '/* ERROR: No User Agent available */';
48
        $out = '/* ERROR: No User Agent available */';
Line 63... Line 63...
63
                $url = 'https://polyfill.io/v3/polyfill.min.js?features='.urlencode(implode(',',REQUIRED_POLYFILLS));
63
                $url = 'https://polyfill.io/v3/polyfill.min.js?features='.urlencode(implode(',',REQUIRED_POLYFILLS));
64
        } else {
64
        } else {
65
                $url = 'https://polyfill.io/v3/polyfill.js?features='.urlencode(implode(',',REQUIRED_POLYFILLS));
65
                $url = 'https://polyfill.io/v3/polyfill.js?features='.urlencode(implode(',',REQUIRED_POLYFILLS));
66
        }
66
        }
67
 
67
 
-
 
68
        if (!url_get_contents_available(true, $reason)) {
-
 
69
                $out = '/* ERROR: Cannot connect to the Internet. '.$reason.' */';
-
 
70
                httpOutWithETag($out, 'application/javascript', 'polyfill'.(MINIFY_POLYFILL ? '.min' : '').'.js');
-
 
71
        }
-
 
72
 
68
        $cont = url_get_contents($url, [], $ua);
73
        $cont = url_get_contents($url, [], $ua);
69
 
74
 
70
        if ($cont === false) {
75
        if ($cont === false) {
71
 
76
 
72
                if (file_exists($cache_file)) {
77
                if (file_exists($cache_file)) {