Skip to content

bugfix backup / restore#12296

Merged
mhcwebdesign merged 1 commit intoopencart:3.0.x.x_Maintenancefrom
mhcwebdesign:3.0.x.x_Maintenance
Apr 27, 2023
Merged

bugfix backup / restore#12296
mhcwebdesign merged 1 commit intoopencart:3.0.x.x_Maintenancefrom
mhcwebdesign:3.0.x.x_Maintenance

Conversation

@mhcwebdesign
Copy link
Copy Markdown
Contributor

For admin/model/tool/backup.php, method backup: Some fields can contain NULL value, which isn't compatible with string nor array!

@mhcwebdesign mhcwebdesign merged commit f4dd6e0 into opencart:3.0.x.x_Maintenance Apr 27, 2023
@ADDCreative
Copy link
Copy Markdown
Contributor

Beat me to it.

Master has same issue.

foreach (array_values($result) as $value) {
$value = str_replace(["\x00", "\x0a", "\x0d", "\x1a"], ['\0', '\n', '\r', '\Z'], $value);
$value = str_replace(["\n", "\r", "\t"], ['\n', '\r', '\t'], $value);
$value = str_replace('\\', '\\\\', $value);
$value = str_replace('\'', '\\\'', $value);
$value = str_replace('\\\n', '\n', $value);
$value = str_replace('\\\r', '\r', $value);
$value = str_replace('\\\t', '\t', $value);
$values .= '\'' . $value . '\', ';
}

@mhcwebdesign
Copy link
Copy Markdown
Contributor Author

Beat me to it.

Master has same issue.

foreach (array_values($result) as $value) {
$value = str_replace(["\x00", "\x0a", "\x0d", "\x1a"], ['\0', '\n', '\r', '\Z'], $value);
$value = str_replace(["\n", "\r", "\t"], ['\n', '\r', '\t'], $value);
$value = str_replace('\\', '\\\\', $value);
$value = str_replace('\'', '\\\'', $value);
$value = str_replace('\\\n', '\n', $value);
$value = str_replace('\\\r', '\r', $value);
$value = str_replace('\\\t', '\t', $value);
$values .= '\'' . $value . '\', ';
}

@ADDCreative : Could you create a pull-request for this, for the master branch? For some reason, my local GitCola client on my Linux box won't work, I find the whole github way of things frustrating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants