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