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

Refactoring filemanager/execute.php #11457

Merged
merged 1 commit into from Nov 22, 2018

Conversation

Projects
None yet
4 participants
@PierreRambaud
Contributor

PierreRambaud commented Nov 21, 2018

Questions Answers
Branch? 1.7.5.x
Description? Clear path and path_thumb.
Type? refacto
Category? BO
BC breaks? no
Deprecations? no
How to test? You should be able to create directory / file, upload, rename and delete.

This change is Reviewable

@PierreRambaud PierreRambaud added this to the 1.7.5.0 milestone Nov 21, 2018

} else {
$path = $current_path;
}
$path = isset($_POST['path']) ? ($current_path . $_POST['path']) : $current_path;

This comment has been minimized.

@Quetzacoalt91

Quetzacoalt91 Nov 21, 2018

Member

With your PR, isset($_POST['path']) is now always true.

This comment has been minimized.

@PierreRambaud

PierreRambaud Nov 21, 2018

Contributor

There are many require above, I can't trust anything, that's why I keep the isset test :/

$_POST['path_thumb'] = $thumbs_base_path.$_POST['path_thumb'];
if (!isset($_POST['path_thumb']) && trim($_POST['path_thumb']) == '') {
$_POST['path'] = isset($_POST['path']) ? str_replace("\0", '', $_POST['path']) : null;
$_POST['path_thumb'] = isset($_POST['path_thumb']) ? $thumbs_base_path . str_replace("\0", '', $_POST['path_thumb']) : null;

This comment has been minimized.

@Quetzacoalt91

Quetzacoalt91 Nov 21, 2018

Member

Why choosing null and not an empty string?

This comment has been minimized.

@PierreRambaud

PierreRambaud Nov 21, 2018

Contributor

Just because if $_POST['thisIsAKey'] doesn't exists, it's logically null, but I can change if you want.

@ntiepresta ntiepresta self-assigned this Nov 22, 2018

@ntiepresta ntiepresta added QA ✔️ and removed waiting for QA labels Nov 22, 2018

@ntiepresta ntiepresta removed their assignment Nov 22, 2018

@Quetzacoalt91 Quetzacoalt91 merged commit 3b04cf7 into PrestaShop:1.7.5.x Nov 22, 2018

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Quetzacoalt91

This comment has been minimized.

Member

Quetzacoalt91 commented Nov 22, 2018

Thank you @PierreRambaud

@PierreRambaud PierreRambaud deleted the PierreRambaud:refactoring-filemanager branch Nov 22, 2018

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