Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 973a376937
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (19 sloc) 0.731 kb
<?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>
$manifest = ' manifest="html5demo.appcache"';
}
include('includes/header.php');
echo $file;
include('includes/footer.php');
} else {
header("HTTP/1.0 404 Not Found");
echo 'File not found';
}
?>
Jump to Line
Something went wrong with that request. Please try again.