Forcibily use 10 as base for parsed numbers, otherwise accidentally octal numbers are expected (part of bug #1005865).

This commit is contained in:
Michal Čihař
2004-08-10 12:30:03 +00:00
parent 8eb22f4e7b
commit ee07b93332
2 changed files with 20 additions and 15 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-08-10 Michal Čihař <michal@cihar.com>
* libraries/tbl_change.js: Forcibily use 10 as base for parsed numbers,
otherwise accidentally octal numbers are expected (part of bug
#1005865).
2004-08-09 Marc Delisle <lem9@users.sourceforge.net> 2004-08-09 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to Bora Alioglu * lang/turkish update, thanks to Bora Alioglu
* libraries/get_foreign.lib.php: bug 1005826, problem with foreign key * libraries/get_foreign.lib.php: bug 1005826, problem with foreign key

View File

@@ -194,22 +194,22 @@ function initCalendar() {
if (parts[1]) { if (parts[1]) {
time = parts[1].split(':'); time = parts[1].split(':');
hour = parseInt(time[0]); hour = parseInt(time[0],10);
minute = parseInt(time[1]); minute = parseInt(time[1],10);
second = parseInt(time[2]); second = parseInt(time[2],10);
} }
} }
date = value.split("-"); date = value.split("-");
day = parseInt(date[2]); day = parseInt(date[2],10);
month = parseInt(date[1]) - 1; month = parseInt(date[1],10) - 1;
year = parseInt(date[0]); year = parseInt(date[0],10);
} else { } else {
year = parseInt(value.substr(0,4)); year = parseInt(value.substr(0,4),10);
month = parseInt(value.substr(4,2)) - 1; month = parseInt(value.substr(4,2),10) - 1;
day = parseInt(value.substr(6,2)); day = parseInt(value.substr(6,2),10);
hour = parseInt(value.substr(8,2)); hour = parseInt(value.substr(8,2),10);
minute = parseInt(value.substr(10,2)); minute = parseInt(value.substr(10,2),10);
second = parseInt(value.substr(12,2)); second = parseInt(value.substr(12,2),10);
} }
} }
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) { if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
@@ -333,9 +333,9 @@ function returnDate(d) {
txt = d; txt = d;
if (window.opener.dateType != 'date') { if (window.opener.dateType != 'date') {
// need to get time // need to get time
h = parseInt(document.getElementById('hour').value); h = parseInt(document.getElementById('hour').value,10);
m = parseInt(document.getElementById('minute').value); m = parseInt(document.getElementById('minute').value,10);
s = parseInt(document.getElementById('second').value); s = parseInt(document.getElementById('second').value,10);
if (window.opener.dateType == 'datetime') { if (window.opener.dateType == 'datetime') {
txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second'); txt += ' ' + formatNum2(h, 'hour') + ':' + formatNum2(m, 'minute') + ':' + formatNum2(s, 'second');
} else { } else {