From aff87cc9f171cd12fb4b40f061cea12fc4cce45a Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Mon, 27 Jun 2011 16:50:01 -0700 Subject: [PATCH] Fix for the mysterious "page is too large" error Todd and Scott were seeing on Blackberry 5 prior to shipping jQM beta 1. Turns out this little code was enough to invoke the error: "/dir1/dir2".replace(/\/?/, ""); Rewrote the regexp in path.makePathAbsolute() that was stripping leading slash, and trailing filename/slash. This gets around the problem. Special thanks to @adambiggs for helping me test 33 iterations when trying to narrow down what in jquery.mobile.navigation.js was choking BB5. --- js/jquery.mobile.navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 8a53127f..974d6bf6 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -88,7 +88,7 @@ } relPath = relPath || ""; - absPath = absPath ? absPath.replace( /^\/|\/?[^\/]*$/g, "" ) : ""; + absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : ""; var absStack = absPath ? absPath.split( "/" ) : [], relStack = relPath.split( "/" );