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

Update count param consistently. #31227

Merged
merged 2 commits into from Nov 22, 2021
Merged

Update count param consistently. #31227

merged 2 commits into from Nov 22, 2021

Conversation

vedanshujain
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

As far as I can see, this count param is not really needed, but it will still be good to keep it updated in case its getting used in an edge case that I have not considered.

How to test the changes in this Pull Request:

This is more of a consistency fix. Make sure all test case pass.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Changelog entry

Fix - Update count param consistently to make remote_file param accurate.

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

barryhughes
barryhughes previously approved these changes Nov 17, 2021
Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :-)

Some checks are not passing—looks unrelated, may just need a rebase and a few more spins of the wheel to get them passing (but holding on merging until they are green).

As far as I can see, this count param is not really needed, but it will still be good to keep it updated in case its getting used in an edge case that I have not considered.
@barryhughes
Copy link
Member

✍🏽 Looks like the failing check is unrelated and also is solved by this PR.

@@ -270,7 +270,7 @@ public static function parse_file_path( $file_path ) {
);

$count = 0;
$file_path = str_replace( array_keys( $replacements ), array_values( $replacements ), $file_path );
$file_path = str_replace( array_keys( $replacements ), array_values( $replacements ), $file_path, $count );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, we no longer need to explicitly initialize $count to zero (line 272) but I think it's fine/actually makes things a little clearer.

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@barryhughes barryhughes merged commit 5773089 into trunk Nov 22, 2021
@barryhughes barryhughes deleted the fix/count_param branch November 22, 2021 19:34
@github-actions github-actions bot added this to the 6.1.0 milestone Nov 22, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2021

Hi @barryhughes, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the status: needs changelog label
  • Add the status: needs testing instructions label

@barryhughes barryhughes added the release: add changelog Mark all PRs that have not had their changelog entries added. [auto] label Nov 22, 2021
@jonathansadowski jonathansadowski added changelog added and removed release: add changelog Mark all PRs that have not had their changelog entries added. [auto] labels Dec 17, 2021
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

3 participants