Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix backup / restore #12296

Merged
merged 1 commit into from Apr 27, 2023
Merged

bugfix backup / restore #12296

merged 1 commit into from Apr 27, 2023

Conversation

mhcwebdesign
Copy link
Collaborator

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
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
Collaborator 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.

None yet

2 participants