Skip to content

Commit 808784f

Browse files
committed
Incorrect format basepath
1 parent 9964240 commit 808784f

6 files changed

Lines changed: 38 additions & 34 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "history",
33
"repo": "devote/HTML5-History-API",
44
"description": "HTML5 History API expansion for browsers not supporting pushState, replaceState",
5-
"version": "4.1.2",
5+
"version": "4.1.3",
66
"keywords": ["history", "pushState", "replaceState"],
77
"main": "history.js",
88
"scripts": ["history.js"],

history.iegte8.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* History API JavaScript Library v4.1.2
2+
* History API JavaScript Library v4.1.3
33
*
44
* Support: IE8+, FF3+, Opera 9+, Safari, Chrome and other
55
*
@@ -11,7 +11,7 @@
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-04-29 15:30
14+
* Update: 2014-05-14 14:06
1515
*/
1616
(function(window) {
1717
// Prevent the code from running if there is no window.history object
@@ -113,7 +113,8 @@
113113
* @param {String} [basepath]
114114
*/
115115
"redirect": function(type, basepath) {
116-
settings["basepath"] = basepath = basepath == null ? settings["basepath"] : basepath;
116+
settings["basepath"] = ('' + (basepath = basepath == null ?
117+
settings["basepath"] : basepath)).replace(/(?:^|\/)[^\/]*$/, '/');
117118
settings["type"] = type = type == null ? settings["type"] : type;
118119
if (window.top == window.self) {
119120
var relative = parseURL(null, false, true)._relative;
@@ -859,7 +860,8 @@
859860
var src = (scripts[scripts.length - 1] || {}).src || '';
860861
var arg = src.indexOf('?') !== -1 ? src.split('?').pop() : '';
861862
arg.replace(/(\w+)(?:=([^&]*))?/g, function(a, key, value) {
862-
settings[key] = (value || (key === 'basepath' ? '/' : '')).replace(/^(0|false)$/, '');
863+
value = (value || '').replace(/^(0|false)$/, '');
864+
settings[key] = key === 'basepath' ? value.replace(/(?:^|\/)[^\/]*$/, '/') : value;
863865
});
864866

865867
/**

history.iegte8.min.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

history.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*!
2-
* History API JavaScript Library v4.1.2
2+
* History API JavaScript Library v4.1.3
33
*
44
* Support: IE6+, FF3+, Opera 9+, Safari, Chrome and other
55
*
6-
* Copyright 2011-2013, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
6+
* Copyright 2011-2014, Dmitrii Pakhtinov ( spb.piksel@gmail.com )
77
*
88
* http://spb-piksel.ru/
99
*
1010
* Dual licensed under the MIT and GPL licenses:
1111
* http://www.opensource.org/licenses/mit-license.php
1212
* http://www.gnu.org/licenses/gpl.html
1313
*
14-
* Update: 2014-04-29 15:30
14+
* Update: 2014-05-14 14:06
1515
*/
1616
(function(window) {
1717
// Prevent the code from running if there is no window.history object
@@ -113,7 +113,8 @@
113113
* @param {String} [basepath]
114114
*/
115115
"redirect": function(type, basepath) {
116-
settings["basepath"] = basepath = basepath == null ? settings["basepath"] : basepath;
116+
settings["basepath"] = basepath = ('' + (basepath == null ?
117+
settings["basepath"] : basepath)).replace(/(?:^|\/)[^\/]*$/, '/');
117118
settings["type"] = type = type == null ? settings["type"] : type;
118119
if (window.top == window.self) {
119120
var relative = parseURL(null, false, true)._relative;
@@ -859,7 +860,8 @@
859860
var src = (scripts[scripts.length - 1] || {}).src || '';
860861
var arg = src.indexOf('?') !== -1 ? src.split('?').pop() : '';
861862
arg.replace(/(\w+)(?:=([^&]*))?/g, function(a, key, value) {
862-
settings[key] = (value || (key === 'basepath' ? '/' : '')).replace(/^(0|false)$/, '');
863+
value = (value || '').replace(/^(0|false)$/, '');
864+
settings[key] = key === 'basepath' ? value.replace(/(?:^|\/)[^\/]*$/, '/') : value;
863865
});
864866

865867
/**

0 commit comments

Comments
 (0)