website
- fix loading version number from renamed internal assets - remove various php notice/warnings from the webserver logs
This commit is contained in:
parent
48a7a688f8
commit
9575e4b4c2
@ -86,7 +86,9 @@ $pages = Array (
|
||||
'donate' => '<i class="icon-gift"></i> Donate',
|
||||
);
|
||||
|
||||
$page = $_REQUEST['page'];
|
||||
$page = 'home';
|
||||
if ( array_key_exists ( 'page', $_REQUEST ) )
|
||||
$page = $_REQUEST['page'];
|
||||
if ( ! array_key_exists ( $page, $pages ) )
|
||||
$page = "home";
|
||||
|
||||
|
@ -17,15 +17,21 @@ function getMobileVersion ( $apkfile )
|
||||
|
||||
|
||||
$archive = $apkinfo->getApkArchive();
|
||||
$iitc_file = "assets/total-conversion-build.user.js";
|
||||
if ( $archive->statName ( $iitc_file ) === FALSE );
|
||||
$iitc_file = "assets/iitc.js";
|
||||
|
||||
$stream = $archive->getStream ( $iitc_file );
|
||||
$stream = $archive->getStream ( "assets/total-conversion-build.user.js" );
|
||||
if ( ! $stream )
|
||||
$stream = $archive->getStream ( "assets/iitc.js" );
|
||||
|
||||
if ( $stream )
|
||||
{
|
||||
$header = loadUserScriptHeader ( $stream );
|
||||
|
||||
$result['iitc_version'] = $header['@version'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['iitc_version'] = 'unknown';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -40,7 +46,7 @@ function iitcMobileDownload ( $apkfile )
|
||||
|
||||
# we need an absolute link for the QR Code
|
||||
# get the URL of this page itself
|
||||
$pageurl = ($_SERVER['HTTPS'] ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
$pageurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
$apkurl = url_to_absolute ( $pageurl, $apkfile );
|
||||
?>
|
||||
|
||||
|
@ -26,7 +26,7 @@ function loadUserScriptHeader($file)
|
||||
}
|
||||
}
|
||||
|
||||
fclose ( $f );
|
||||
fclose ( $file );
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -19,10 +19,13 @@ include_once ( "code/desktop-download.php" );
|
||||
|
||||
$path = "test";
|
||||
|
||||
if ( $_REQUEST['build'] == 'experimental' )
|
||||
if ( array_key_exists ( 'build', $_REQUEST ) )
|
||||
{
|
||||
if ( $_REQUEST['build'] == 'experimental' )
|
||||
$path = "experimental";
|
||||
if ( $_REQUEST['build'] == 'dev' )
|
||||
if ( $_REQUEST['build'] == 'dev' )
|
||||
$path = "dev";
|
||||
}
|
||||
|
||||
if ( $path != "test" )
|
||||
print "<div class=\"alert alert-block alert-error\"><b>NOTE</b>: A non-standard test build, <b>$path</b>, is currently selected. The notes <b>may not apply!</b> <a href=\"?page=test\">Return to the standard test build</a>.</div>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user