Ticket #22267: 22267.c.patch
File 22267.c.patch, 1.2 KB (added by , 11 years ago) |
---|
-
formatting.php
1362 1362 * @param string $string What to add the trailing slash to. 1363 1363 * @return string String with trailing slash added. 1364 1364 */ 1365 function trailingslashit( $string) {1366 return untrailingslashit( $string) . '/';1365 function trailingslashit( $string ) { 1366 return untrailingslashit( $string ) . '/'; 1367 1367 } 1368 1368 1369 1369 /** 1370 * Removes trailing slash if it exists.1370 * Removes trailing slash or backslash if it exists. 1371 1371 * 1372 1372 * The primary use of this is for paths and thus should be used for paths. It is 1373 1373 * not restricted to paths and offers no specific path support. 1374 1374 * 1375 1375 * @since 2.2.0 1376 1376 * 1377 * @param string $string What to remove the trailing slash from.1378 * @return string String without the trailing slash .1377 * @param string $string What to remove the trailing slash or backslash from. 1378 * @return string String without the trailing slash or backslash. 1379 1379 */ 1380 function untrailingslashit( $string) {1381 return rtrim( $string, '/');1380 function untrailingslashit( $string ) { 1381 return rtrim( $string, '/' . chr( 92 ) ); 1382 1382 } 1383 1383 1384 1384 /**