1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Be a bit more kind to those who run non-official mirror sites

for some reason (like I do for testing stuff :), and allow setting
of My PHP.net settings on these sites too. But do notify users
that unofficial mirror site settings are not goint to carried to the
official mirror sites.
This commit is contained in:
Gabor Hojtsy
2003-08-16 10:55:08 +00:00
parent 0334d15826
commit b1b69ccaa2
2 changed files with 15 additions and 3 deletions

View File

@@ -153,7 +153,11 @@ function mirror_redirect($absoluteURI, $remote = FALSE)
function mirror_setcookie($name, $content, $exptime)
{
if (!headers_sent()) {
return setcookie($name, $content, time() + $exptime, '/', '.php.net');
if (is_official_mirror()) {
return setcookie($name, $content, time() + $exptime, '/', '.php.net');
} else {
return setcookie($name, $content, time() + $exptime, '/');
}
} else {
return FALSE;
}

12
my.php
View File

@@ -71,15 +71,23 @@ site_header("My PHP.net");
<p>
This page allows you to customize the PHP.net site to some degree
to your own liking. Currently you can only set the language you
prefer, thus overriding any other automatic language selection.
to your own liking.
</p>
<?php if (!is_official_mirror()) { ?>
<p class="warn">
This is not an official PHP.net mirror site, and therefore the settings
you set and see here will <strong>not</strong> be effective on any
official PHP.net mirror site. The settings you specify here are only
going to be active for this URL, and only if you have cookies enabled.
</p>
<?php } else { ?>
<p>
These settings will be active on all official PHP.net mirror sites,
and are stored using cookies, so you need to have cookies enabled
to let your settings work.
</p>
<?php } ?>
<h2>Preferred language</h2>