| Versionen | |
|---|---|
| drupal6 – drupal7 | drupal_urlencode($text) |
Wrapper around urlencode() which avoids Apache quirks.
Should be used when placing arbitrary data in an URL. Note that Drupal paths are urlencoded() when passed through url() and do not require urlencoding() of individual components.
Notes:
$text String to encode
includes/
<?php
function drupal_urlencode($text) {
if (variable_get('clean_url', '0')) {
return str_replace(array('%2F', '%26', '%23', '//'),
array('/', '%2526', '%2523', '/%252F'),
rawurlencode($text));
}
else {
return str_replace('%2F', '/', rawurlencode($text));
}
}
?>
Kommentare
Kommentar hinzufügen