Commit:    928777195196a4d90ea48ec34d095ea89d8438a3
Author:    Adam Harvey <[email protected]>         Fri, 7 Jan 2011 11:03:09 +0000
Parents:   98b76009bd5aabca2cc93609441d29d93714b729
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=928777195196a4d90ea48ec34d095ea89d8438a3

Log:
Quiet notices when we don't have $_SERVER['BASE_PAGE'] available.

Changed paths:
  M  include/header.inc
  M  include/layout.inc


Diff:
diff --git a/include/header.inc b/include/header.inc
index c374168..df42271 100644
--- a/include/header.inc
+++ b/include/header.inc
@@ -8,7 +8,7 @@ header("Pragma: no-cache");
 // Version information for the mega drop down.
 include $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc';
 
-if ($shortname) {
+if (isset($shortname) && $shortname) {
     header("Link: <$shorturl>; rel=shorturl");
 }
 
@@ -25,10 +25,14 @@ if ($shortname) {
  <link rel="search" type="application/opensearchdescription+xml" 
href="http://www.php.net/phpnetimprovedsearch.src"; title="Add PHP.net search" />
  <link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE 
?>releases.atom" title="PHP Release feed" />
  <link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE 
?>feed.atom" title="PHP: Hypertext Preprocessor" />
+
+<?php if (isset($_SERVER['BASE_PAGE'])): ?>
  <link rel="canonical" href="http://php.net/<?php echo 
$_SERVER['BASE_PAGE']?>" />
 <?php if ($shortname): ?>
  <link rel="shorturl" href="<?php echo $shorturl ?>" />
 <?php endif ?>
+<?php endif ?>
+
 <?php foreach($config["meta-navigation"] as $rel => $page): ?>
  <link rel="<?php echo $rel ?>" href="<?php echo $MYSITE ?><?php echo $page 
?>" />
 <?php endforeach ?>
diff --git a/include/layout.inc b/include/layout.inc
index cc8834a..ad1c9e1 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -806,7 +806,7 @@ function site_header_beta($title = '', $config = array())
     }
 
     // shorturl; http://wiki.snaplog.com/short_url
-    if ($shortname = get_shortname($_SERVER["BASE_PAGE"])) {
+    if (isset($_SERVER['BASE_PAGE']) && $shortname = 
get_shortname($_SERVER["BASE_PAGE"])) {
         $shorturl = "http://php.net/"; . $shortname;
     }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to