#2122 closed defect (bug) (wontfix)
Patch for wp-db-backup
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.0 |
| Severity: | major | Keywords: | backup plugin |
| Cc: |
Description
Hi, I'm submitting this ticket after I found a bug in the plugin WP-DB-Backup 1.7 that I use with Wordpress1.5. As this plugin is included in the next WP version maybe this can be useful.
I found that the backup_table() function does not handle NULL values, so the script generated may be incorrect.
To solve the problem I changed the loop:
foreach ($row as $key => $value) {
if ($ints[strtolower($key)]) {
$values[] = $value;
} else {
$values[] = "'" . str_replace($search, $replace, $this->sql_addslashes($value)) . "'";
}
}
with the following got from http://www.restkultur.ch/personal/wolf/scripts/db_backup/:
foreach ($row as $key => $value) {
if (!isset($row[$key])) {
$values[] = 'NULL';
}
else if ($value == '0' || $value != '') {
// a number
if ($ints[strtolower($key)]) {
$values[] = $value;
}
else {
$values[] = "'" . str_replace($search, $replace, $this->sql_addslashes($value)) . "'";
}
}
else {
$values[] = "''";
}
}
With this change the backup script is more aderent to phpmyadmin.
Bye,
Cristian
Change History (4)
Note: See
TracTickets for help on using
tickets.

wp-db-backup is no longer part of trunk.