mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 15:46:04 +01:00
Improvements to untrailingslashit() and trailingslashit(). props Jamie Talbot. fixes #3899
git-svn-id: http://svn.automattic.com/wordpress/trunk@5021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
de23b425c3
commit
98e4d11c00
@ -563,13 +563,11 @@ function backslashit($string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function trailingslashit($string) {
|
function trailingslashit($string) {
|
||||||
if ( '/' != substr($string, -1))
|
return untrailingslashit($string) . '/';
|
||||||
$string .= '/';
|
|
||||||
return $string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function untrailingslashit($string) {
|
function untrailingslashit($string) {
|
||||||
return preg_replace('|/+$|', '', $string);
|
return rtrim($string, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
function addslashes_gpc($gpc) {
|
function addslashes_gpc($gpc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user