diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..bde2085 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,285 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. +unction ($uri): void { + // Special redirect cases not able to be captured in error.php + $shortcuts = [ + '/?:' => '/language.operators.comparison#language.operators.comparison.ternary', + '/??' => '/language.operators.comparison#language.operators.comparison.coalesce', + '/??=' => '/language.operators.assignment#language.operators.assignment.other', + ]; + if (isset($shortcuts[$uri])) { + header("Location: {$shortcuts[$uri]}"); + exit; + } +})($_SERVER['REQUEST_URI'] ?? ''); + +// Get the modification date of this PHP file +$timestamps = [@getlastmod()]; + +/* + The date of prepend.inc represents the age of ALL + included files. Please touch it if you modify any + other include file (and the modification affects + the display of the index page). The cost of stat'ing + them all is prohibitive. +*/ +$timestamps[] = @filemtime("include/prepend.inc"); + +// These are the only dynamic parts of the frontpage +$timestamps[] = @filemtime("include/pregen-confs.inc"); +$timestamps[] = @filemtime("include/pregen-news.inc"); +$timestamps[] = @filemtime("include/version.inc"); +$timestamps[] = @filemtime("js/common.js"); + +// The latest of these modification dates is our real Last-Modified date +$timestamp = max($timestamps); + +// Note that this is not a RFC 822 date (the tz is always GMT) +$tsstring = gmdate("D, d M Y H:i:s ", $timestamp) . "GMT"; + +// Check if the client has the same page cached +if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"]) && + ($_SERVER["HTTP_IF_MODIFIED_SINCE"] == $tsstring)) { + header("HTTP/1.1 304 Not Modified"); + exit(); +} + +// Inform the user agent what is our last modification date +header("Last-Modified: " . $tsstring); + +$_SERVER['BASE_PAGE'] = 'index.php'; +include_once 'include/prepend.inc'; +include_once 'include/branches.inc'; +include_once 'include/pregen-confs.inc'; +include_once 'include/pregen-news.inc'; +include_once 'include/version.inc'; + +mirror_setcookie("LAST_NEWS", $_SERVER["REQUEST_TIME"], 60 * 60 * 24 * 365); + +$content = "
A popular general-purpose scripting language that is especially suited to web development.
Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.
The PHP Foundation is a collective of people and organizations, united in the mission to ensure the long-term prosperity of the PHP language. +
+