2010-03-04 13:07:09 +01:00
|
|
|
<?php
|
|
|
|
$request = preg_replace('/[^0-9a-z-_]/', '', preg_replace('/^\//', '', preg_replace('/\/$/', '', preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']))));
|
|
|
|
if (file_exists('demos/' . $request . '.html')) {
|
|
|
|
$file = file_get_contents('demos/' . $request . '.html');
|
|
|
|
preg_match('/<title>(.*)<\/title>/', $file, $matches);
|
|
|
|
$file = preg_replace('/<title>(.*?)<\/title>/', '', $file);
|
|
|
|
$title = $matches[1];
|
|
|
|
|
|
|
|
$manifest = '';
|
|
|
|
if ($request == 'offlineapp') { // specific change to support <html manifest=xyz>
|
2011-05-17 17:28:16 +02:00
|
|
|
$manifest = ' manifest="html5demo.appcache"';
|
2010-03-04 13:07:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
include('includes/header.php');
|
|
|
|
echo $file;
|
|
|
|
include('includes/footer.php');
|
|
|
|
} else {
|
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
echo 'File not found';
|
|
|
|
}
|
|
|
|
|
2011-05-17 17:28:16 +02:00
|
|
|
?>
|