WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 6 weeks ago

Last modified 6 weeks ago

#41970 closed enhancement (fixed)

Removed unused variable.

Reported by: adnan.limdi Owned by: SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:
PR Number:

Description

I have found wp_current_db_version variable not use in functions so need to remove this for improvement.
file locations :
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/upgrade.php line no:1596

Attachments (1)

remove-unused-variable.patch (534 bytes) - added by adnan.limdi 2 years ago.
Remove Unused variable

Download all attachments as: .zip

Change History (10)

@adnan.limdi
2 years ago

Remove Unused variable

#1 follow-up: @adnan.limdi
2 years ago

<?php
1625    $comments = $wpdb->get_results(
                "SELECT `comment_ID` FROM `{$wpdb->comments}`
                        WHERE `comment_date_gmt` > '2015-04-26'
                        AND LENGTH( `comment_content` ) >= {$allowed_length}
                        AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
        );

Also I See This here date is define static : WHERE comment_date_gmt > '2015-04-26' so we need to update this for future version.

#2 @adnan.limdi
2 years ago

  • Keywords has-patch added

#3 in reply to: ↑ 1 ; follow-up: @SergeyBiryukov
2 years ago

  • Component changed from General to Upgrade/Install

Replying to adnan.limdi:

Also I See This here date is define static : WHERE comment_date_gmt > '2015-04-26' so we need to update this for future version.

Thanks for the patch. The unused variable can be removed, but the date is specific to the security fix in [32308], there's no need to update it in a future version.

#4 in reply to: ↑ 3 @adnan.limdi
2 years ago

Replying to SergeyBiryukov:

Replying to adnan.limdi:

Also I See This here date is define static : WHERE comment_date_gmt > '2015-04-26' so we need to update this for future version.

Thanks for the patch. The unused variable can be removed, but the date is specific to the security fix in [32308], there's no need to update it in a future version.

ok, @SergeyBiryukov thanks for the response.

Last edited 2 years ago by adnan.limdi (previous) (diff)

#5 @adnan.limdi
2 years ago

@SergeyBiryukov can you please review it.

#6 @adnan.limdi
6 weeks ago

@SergeyBiryukov can you close this tickit if it's sloved

This ticket was mentioned in Slack in #core by testiflair. View the logs.


6 weeks ago

#8 @SergeyBiryukov
6 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 46972:

Upgrade/Install: Remove unused global in upgrade_430_fix_comments().

Props adnan.limdi.
Fixes #41970.

#9 @SergeyBiryukov
6 weeks ago

  • Milestone changed from Awaiting Review to 5.4
Note: See TracTickets for help on using tickets.