From f80f775dfbe12cf6b95bda38b73f5dc37327d7fa Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Thu, 26 Jul 2018 15:09:50 +0100 Subject: Change the "private file" prefix from "@" to "_" It has all the benefits previously mentioned in commit 2f547251, as well as mirroring the common programming convention of using a "_" prefix to identify private variables/functions Hides files beginning with _ from mod_autoindex listings As well as 404ing on files starting with "_", also 404 on files starting with ".", as these are also private. Except for /.well-known/, because that's... well known, and should be public. --- html/@include.php | 66 ------------------------------------------------- html/_include.php | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ html/about | 2 +- html/contact | 2 +- html/index.php | 2 +- html/privacy | 2 +- html/projects/index.php | 2 +- 7 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 html/@include.php create mode 100644 html/_include.php (limited to 'html') diff --git a/html/@include.php b/html/@include.php deleted file mode 100644 index 7ce79b0..0000000 --- a/html/@include.php +++ /dev/null @@ -1,66 +0,0 @@ - elements for the site -function site_head($title) { - return "{$title}\n" - . "\n" - . "\n" - . "\n" - . "\n"; -} - -/// Get a single top-level navigation item for the site -function site_navitem($url, $text, $hide = false) { - $selected = $url == $_SERVER['REQUEST_URI']; - - $classes = []; - if ($selected) { - $classes[] = "selected"; - } - if ($hide && !$selected) { - $classes[] = "hidden"; - } - $classes = count($classes) > 0 ? (" class=\"" . implode(" ", $classes) . "\"") : ""; - - return "{$text}"; -} - -/// Get the standard page header elements for the site -function site_header($title) { - return "

{$title}

\n" - . "\n"; -} - -/// Get the standard page footer elements for the site -function site_footer() { - return "
\n" - . "

Spragg Software Services Ltd is registered in England, No. 11248242.\n" - . " Registered office: 82 Upper Hanover Street, Sheffield, S3 7RQ.\n" - . " VAT reg No. 295343283.

\n"; -} - -?> diff --git a/html/_include.php b/html/_include.php new file mode 100644 index 0000000..7ce79b0 --- /dev/null +++ b/html/_include.php @@ -0,0 +1,66 @@ + elements for the site +function site_head($title) { + return "{$title}\n" + . "\n" + . "\n" + . "\n" + . "\n"; +} + +/// Get a single top-level navigation item for the site +function site_navitem($url, $text, $hide = false) { + $selected = $url == $_SERVER['REQUEST_URI']; + + $classes = []; + if ($selected) { + $classes[] = "selected"; + } + if ($hide && !$selected) { + $classes[] = "hidden"; + } + $classes = count($classes) > 0 ? (" class=\"" . implode(" ", $classes) . "\"") : ""; + + return "{$text}"; +} + +/// Get the standard page header elements for the site +function site_header($title) { + return "

{$title}

\n" + . "\n"; +} + +/// Get the standard page footer elements for the site +function site_footer() { + return "
\n" + . "

Spragg Software Services Ltd is registered in England, No. 11248242.\n" + . " Registered office: 82 Upper Hanover Street, Sheffield, S3 7RQ.\n" + . " VAT reg No. 295343283.

\n"; +} + +?> diff --git a/html/about b/html/about index fa4d544..4092829 100644 --- a/html/about +++ b/html/about @@ -1,4 +1,4 @@ - + diff --git a/html/contact b/html/contact index 632113a..3938f87 100644 --- a/html/contact +++ b/html/contact @@ -1,4 +1,4 @@ - + diff --git a/html/index.php b/html/index.php index 29e0cfa..488d9ba 100644 --- a/html/index.php +++ b/html/index.php @@ -1,4 +1,4 @@ - + diff --git a/html/privacy b/html/privacy index 6d338fd..a04ebd6 100644 --- a/html/privacy +++ b/html/privacy @@ -1,4 +1,4 @@ - + diff --git a/html/projects/index.php b/html/projects/index.php index b995ccf..f7e5f07 100644 --- a/html/projects/index.php +++ b/html/projects/index.php @@ -1,4 +1,4 @@ - + -- cgit v1.2.1