summaryrefslogtreecommitdiff
path: root/opensearch_desc.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
committerPierre Schmitz <pierre@archlinux.de>2008-03-21 11:49:34 +0100
commit086ae52d12011746a75f5588e877347bc0457352 (patch)
treee73263c7a29d0f94fafb874562610e16eb292ba8 /opensearch_desc.php
parent749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff)
Update auf MediaWiki 1.12.0
Diffstat (limited to 'opensearch_desc.php')
-rw-r--r--opensearch_desc.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/opensearch_desc.php b/opensearch_desc.php
index b06b7fee..d766f197 100644
--- a/opensearch_desc.php
+++ b/opensearch_desc.php
@@ -10,11 +10,8 @@ $fullName = "$wgSitename ({$wgLanguageNames[$wgLanguageCode]})";
$shortName = htmlspecialchars( mb_substr( $fullName, 0, 24 ) );
$siteName = htmlspecialchars( $fullName );
-if ( !preg_match( '/^https?:/', $wgFavicon ) ) {
- $favicon = htmlspecialchars( $wgServer . $wgFavicon );
-} else {
- $favicon = htmlspecialchars( $wgFavicon );
-}
+
+$favicon = htmlspecialchars( wfExpandUrl( $wgFavicon ) );
$title = SpecialPage::getTitleFor( 'Search' );
$template = $title->escapeFullURL( 'search={searchTerms}' );
@@ -27,8 +24,9 @@ $response->header( 'Content-type: application/opensearchdescription+xml' );
# Set an Expires header so that squid can cache it for a short time
# Short enough so that the sysadmin barely notices when $wgSitename is changed
-$expiryTime = 300; # 5 minutes
+$expiryTime = 600; # 10 minutes
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiryTime ) . ' GMT' );
+$response->header( 'Cache-control: max-age=600' );
echo <<<EOT
<?xml version="1.0"?>