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) {
|
||||
if ( '/' != substr($string, -1))
|
||||
$string .= '/';
|
||||
return $string;
|
||||
return untrailingslashit($string) . '/';
|
||||
}
|
||||
|
||||
function untrailingslashit($string) {
|
||||
return preg_replace('|/+$|', '', $string);
|
||||
return rtrim($string, '/');
|
||||
}
|
||||
|
||||
function addslashes_gpc($gpc) {
|
||||
|
|
Loading…
Reference in New Issue