Index: formatting.php
===================================================================
--- formatting.php	(revisjon 22289)
+++ formatting.php	(arbeidskopi)
@@ -1360,10 +1360,14 @@
  * @uses untrailingslashit() Unslashes string if it was slashed already.
  *
  * @param string $string What to add the trailing slash to.
+ * @param bool $is_path Optional. Is $string to be considered to be a file path? When true will first remove both / and \ on Windows, but / is always added. Default is false.
  * @return string String with trailing slash added.
  */
-function trailingslashit($string) {
-	return untrailingslashit($string) . '/';
+function trailingslashit( $string, $is_path = false ) {
+    if ( $is_path )
+        return untrailingslashit( $string, $is_path ) . '/';
+    else
+        return untrailingslashit( $string ) . '/';
 }
 
 /**
@@ -1375,10 +1379,14 @@
  * @since 2.2.0
  *
  * @param string $string What to remove the trailing slash from.
+ * @param bool $is_path Optional. Is $string to be considered to be a file path? When true, will remove both slashes and backslashes on Windows. Default is false.
  * @return string String without the trailing slash.
  */
-function untrailingslashit($string) {
-	return rtrim($string, '/');
+function untrailingslashit( $string, $is_path = false ) {
+    if ( $is_path )
+        return rtrim( $string, DIRECTORY_SEPARATOR . '/' );
+    else
+        return rtrim( $string, '/');
 }
 
 /**
