diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2009-04-17 16:05:25 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-04-17 16:05:25 +0000 |
| commit | 4307a2c07f6559a71c3cf67f0cde60704ee373ea (patch) | |
| tree | 5ea5923c11a3931b2d74c1f52fce32c75be4a854 /phpBB | |
| parent | 77e21fc054abb722522e4694813149770980249a (diff) | |
| download | forums-4307a2c07f6559a71c3cf67f0cde60704ee373ea.tar forums-4307a2c07f6559a71c3cf67f0cde60704ee373ea.tar.gz forums-4307a2c07f6559a71c3cf67f0cde60704ee373ea.tar.bz2 forums-4307a2c07f6559a71c3cf67f0cde60704ee373ea.tar.xz forums-4307a2c07f6559a71c3cf67f0cde60704ee373ea.zip | |
Changed jumpto() JS function to be more fail-safe. (But #27635 - patch by peterkclee)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9466 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/adm/style/overall_header.html | 11 | ||||
| -rw-r--r-- | phpBB/adm/style/simple_header.html | 11 | ||||
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 11 | ||||
| -rw-r--r-- | phpBB/styles/subsilver2/template/overall_header.html | 13 |
5 files changed, 38 insertions, 9 deletions
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 0720519ce2..ccf38e49b8 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -28,9 +28,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 3e36c47988..2339b70a93 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -39,9 +39,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 875281d5d2..62c64a9c2a 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -150,6 +150,7 @@ <li>[Change] Add unique key to ACL options table to prevent duplicate permission options. (Bug #41835)</li> <li>[Change] Redirect to relevant MCP page of multi-page topic if accessing quickmod tools (Split option for example)</li> <li>[Change] Performance improvements for native fulltext search (patch by Paul)</li> + <li>[Change] Changed jumpto() JS function to be more fail-safe. (But #27635 - patch by peterkclee)</li> <li>[Feature] Added new options for visual confirmation.</li> <li>[Feature] Allow download of conflicting file for later reference in automatic updater</li> <li>[Feature] Allow translation of custom BBCode help messages. (Patch by bantu)</li> diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 6694dfb61b..06c4d1e785 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -23,9 +23,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 6db4f85690..a2ed06132d 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -39,12 +39,19 @@ function popup(url, width, height, name) function jumpto() { var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}'); - var perpage = '{PER_PAGE}'; + var per_page = '{PER_PAGE}'; var base_url = '{A_BASE_URL}'; - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * perpage); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } |
