Commit 5548431c authored by catch's avatar catch

Issue #2204157 by pjonckiere, sun, Alumei: Remove deprecated URL helper functions from common.inc.

parent a3bb8040
...@@ -420,91 +420,6 @@ function drupal_get_destination() { ...@@ -420,91 +420,6 @@ function drupal_get_destination() {
return $destination; return $destination;
} }
/**
* Parses a system URL string into an associative array suitable for url().
*
* This function should only be used for URLs that have been generated by the
* system, such as via url(). It should not be used for URLs that come from
* external sources, or URLs that link to external resources.
*
* The returned array contains a 'path' that may be passed separately to url().
* For example:
* @code
* $options = drupal_parse_url(\Drupal::request()->query->get('destination'));
* $my_url = url($options['path'], $options);
* $my_link = l('Example link', $options['path'], $options);
* @endcode
*
* This is required, because url() does not support relative URLs containing a
* query string or fragment in its $path argument. Instead, any query string
* needs to be parsed into an associative query parameter array in
* $options['query'] and the fragment into $options['fragment'].
*
* @param $url
* The URL string to parse.
*
* @return
* An associative array containing the keys:
* - 'path': The path of the URL. If the given $url is external, this includes
* the scheme and host.
* - 'query': An array of query parameters of $url, if existent.
* - 'fragment': The fragment of $url, if existent.
*
* @see url()
* @ingroup php_wrappers
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\UrlHelper::parse().
*/
function drupal_parse_url($url) {
return UrlHelper::parse($url);
}
/**
* Encodes a Drupal path for use in a URL.
*
* For aesthetic reasons slashes are not escaped.
*
* Note that url() takes care of calling this function, so a path passed to that
* function should not be encoded in advance.
*
* @param $path
* The Drupal path to encode.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\UrlHelper::encodePath().
*/
function drupal_encode_path($path) {
return UrlHelper::encodePath($path);
}
/**
* Determines if an external URL points to this Drupal installation.
*
* @param $url
* A string containing an external URL, such as "http://example.com/foo".
*
* @return
* TRUE if the URL has the same domain and base path.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\UrlHelper::externalIsLocal().
*/
function _external_url_is_local($url) {
return UrlHelper::externalIsLocal($url, base_path());
}
/**
* Helper function for determining hosts excluded from needing a proxy.
*
* @return
* TRUE if a proxy should be used for this host.
*/
function _drupal_http_use_proxy($host) {
$proxy_exceptions = Settings::get('proxy_exceptions', array('localhost', '127.0.0.1'));
return !in_array(strtolower($host), $proxy_exceptions, TRUE);
}
/** /**
* @} End of "defgroup http_handling". * @} End of "defgroup http_handling".
*/ */
...@@ -531,29 +446,6 @@ function valid_email_address($mail) { ...@@ -531,29 +446,6 @@ function valid_email_address($mail) {
return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL); return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL);
} }
/**
* Verifies the syntax of the given URL.
*
* This function should only be used on actual URLs. It should not be used for
* Drupal menu paths, which can contain arbitrary characters.
* Valid values per RFC 3986.
* @param $url
* The URL to verify.
* @param $absolute
* Whether the URL is absolute (beginning with a scheme such as "http:").
*
* @return
* TRUE if the URL is in a valid format.
*
* @see \Drupal\Component\Utility\UrlHelper::isValid()
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal\Component\Utility\UrlHelper::isValid().
*/
function valid_url($url, $absolute = FALSE) {
return UrlHelper::isValid($url, $absolute);
}
/** /**
* @} End of "defgroup validation". * @} End of "defgroup validation".
*/ */
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
namespace Drupal\Tests\Core; namespace Drupal\Tests\Core;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\Url; use Drupal\Core\Url;
use Drupal\Tests\UnitTestCase; use Drupal\Tests\UnitTestCase;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment