Author: chabotc
Date: Wed Nov 19 01:22:10 2008
New Revision: 718912
URL: http://svn.apache.org/viewvc?rev=718912&view=rev
Log:
SHINDIG-677 by impetus technologies, however changed to use parse_url instead
of the zend uri validator for performance reasons
Modified:
incubator/shindig/trunk/php/src/gadgets/ProxyHandler.php
Modified: incubator/shindig/trunk/php/src/gadgets/ProxyHandler.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/ProxyHandler.php?rev=718912&r1=718911&r2=718912&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/ProxyHandler.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/ProxyHandler.php Wed Nov 19
01:22:10 2008
@@ -338,11 +338,12 @@
private function fetchContent($url, $method)
{
//TODO get actual character encoding from the request
+
// Check the protocol requested - curl doesn't really support
file://
// requests but the 'error' should be handled properly
$protocolSplit = split(":\/\/", $url);
- if (!count($protocolSplit)) {
+ if (! count($protocolSplit)) {
throw new Exception("Invalid protocol specified for
url: $url");
} else {
$protocol = strtoupper($protocolSplit[0]);
@@ -451,9 +452,11 @@
*/
private function validateUrl($url)
{
- //TODO should really make a PHP version of the URI class and
validate in all the locations the java version does
- // why not use Zend::Uri:
- return $url;
+ if ([EMAIL PROTECTED]($url)) {
+ throw new Exception("Invalid Url");
+ } else {
+ return $url;
+ }
}
private function request_headers()