Clean paths so they start with one slash.
This commit is contained in:
@@ -99,13 +99,21 @@ $.save = function( commitMessage ) {
|
||||
var msg = defaultCommitMessage();
|
||||
var newLocation = baseUrl;
|
||||
|
||||
function clean( str ) {
|
||||
return str.replace(/^\/+/g, '/');
|
||||
}
|
||||
|
||||
// 'a%2Fb' => a/b
|
||||
if (pathName) {
|
||||
newLocation += '/' + unescape(pathName);
|
||||
if ( pathName ) {
|
||||
pathName = unescape( pathName );
|
||||
newLocation += '/' + pathName;
|
||||
pathName = pathName + '/'; // pathName must end with /
|
||||
|
||||
pathName = clean( pathName );
|
||||
}
|
||||
|
||||
newLocation += '/' + pageName;
|
||||
newLocation = clean( newLocation );
|
||||
|
||||
// if &create=true then handle create instead of edit.
|
||||
if ( create ) {
|
||||
|
||||
Reference in New Issue
Block a user