[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-cvs
Subject: [PEAR-CVS] cvs: pear /HTTP_WebDAV_Server Server.php
From: "Hartmut Holzgraefe" <hholzgra () php ! net>
Date: 2007-11-30 12:01:41
Message-ID: cvshholzgra1196424101 () cvsserver
[Download RAW message or body]
hholzgra Fri Nov 30 12:01:41 2007 UTC
Modified files:
/pear/HTTP_WebDAV_Server Server.php
Log:
set default host name if just a destination path is given instead
of a full URL (PEAR bug #12500)
http://cvs.php.net/viewvc.cgi/pear/HTTP_WebDAV_Server/Server.php?r1=1.69&r2=1.70&diff_format=u
Index: pear/HTTP_WebDAV_Server/Server.php
diff -u pear/HTTP_WebDAV_Server/Server.php:1.69 pear/HTTP_WebDAV_Server/Server.php:1.70
--- pear/HTTP_WebDAV_Server/Server.php:1.69 Thu Nov 29 21:14:02 2007
+++ pear/HTTP_WebDAV_Server/Server.php Fri Nov 30 12:01:41 2007
@@ -1,4 +1,4 @@
-<?php // $Id: Server.php,v 1.69 2007/11/29 21:14:02 hholzgra Exp $
+<?php // $Id: Server.php,v 1.70 2007/11/30 12:01:41 hholzgra Exp $
/*
+----------------------------------------------------------------------+
| Copyright (c) 2002-2007 Christian Stocker, Hartmut Holzgraefe |
@@ -1513,13 +1513,20 @@
$options["depth"] = "infinity";
}
+ $http_header_host = preg_replace("/:80$/", "", $this->_SERVER["HTTP_HOST"]);
+
$url = parse_url($this->_SERVER["HTTP_DESTINATION"]);
$path = urldecode($url["path"]);
- $http_host = $url["host"];
- if (isset($url["port"]) && $url["port"] != 80)
- $http_host.= ":".$url["port"];
- $http_header_host = preg_replace("/:80$/", "", $this->_SERVER["HTTP_HOST"]);
+ if (isset($url["host"])) {
+ // TODO check url scheme, too
+ $http_host = $url["host"];
+ if (isset($url["port"]) && $url["port"] != 80)
+ $http_host.= ":".$url["port"];
+ } else {
+ // only path given, set host to self
+ $http_host == $http_header_host;
+ }
if ($http_host == $http_header_host &&
!strncmp($this->_SERVER["SCRIPT_NAME"], $path,
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic