summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-06 06:43:19 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-06 06:43:19 +0000
commitf88676a590e872fa6e7a9cbb7305d53034c98070 (patch)
treed0c7d4b4e7197084cbc0f630651f98acf8415c1b
parent757a3ca1732b33a78d4f10438f02adf3610df1c7 (diff)
downloadbrdo-f88676a590e872fa6e7a9cbb7305d53034c98070.tar.gz
brdo-f88676a590e872fa6e7a9cbb7305d53034c98070.tar.bz2
- Patch #499774 by jbrauer: support use of feed:// URLs as synonyms for http:// in core.
-rw-r--r--includes/common.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ecb89071e..3ea773a21 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -792,6 +792,7 @@ function drupal_http_request($url, array $options = array()) {
switch ($uri['scheme']) {
case 'http':
+ case 'feed':
$port = isset($uri['port']) ? $uri['port'] : 80;
$host = $uri['host'] . ($port != 80 ? ':' . $port : '');
$fp = @fsockopen($uri['host'], $port, $errno, $errstr, $options['timeout']);
@@ -1071,7 +1072,7 @@ function valid_url($url, $absolute = FALSE) {
if ($absolute) {
return (bool)preg_match("
/^ # Start at the beginning of the text
- (?:ftp|https?):\/\/ # Look for ftp, http, or https schemes
+ (?:ftp|https?|feed):\/\/ # Look for ftp, http, https or feed schemes
(?: # Userinfo (optional) which is typically
(?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)* # a username or a username and password
(?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@ # combination