WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 4 months ago

#44865 new enhancement

class-wp-locale.php has a condition always false

Reported by: naghmesara Owned by:
Milestone: 5.3 Priority: normal
Severity: normal Version: 4.9.8
Component: I18N Keywords:
Focuses: rtl Cc:

Description

Hi

in class-wp-locale.php from line 224 to 227 We have defined a condition that never runs.

https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-locale.php#L224-L227

<?php
if ( 'rtl' === $this->text_direction && strpos( get_bloginfo( 'version' ), '-src' ) ) {

strpos result always is false because does not have get_bloginfo('version') never ever "-src".

What do you think?

Change History (5)

#1 @naghmesara
11 months ago

  • Focuses rtl added

#2 @SergeyBiryukov
11 months ago

  • Component changed from General to I18N
  • Milestone changed from Awaiting Review to 5.0

Hi @naghmesara, welcome to WordPress Trac! Thanks for the ticket.

strpos result always is false because does not have get_bloginfo('version') never ever "-src"

Interesting. get_bloginfo( 'version' ) does have -src if you run WordPress trunk from the src directory.

RTL files are only available in the build directory, see [26107] for more details.

However, with the new build process introduced in #43055, WP_Locale::rtl_src_admin_notice() and the related code is indeed redundant and could probably be removed, since it's no longer possible to run WordPress from src directory.

#3 @pento
9 months ago

  • Milestone changed from 5.0 to 5.1

#4 @desrosj
6 months ago

  • Milestone changed from 5.1 to 5.2

Now that #44492 and #45863 have landed/are planned, I think that this needs to remain. @SergeyBiryukov can you confirm?

Bumping to 5.2 for further investigation.

#5 @desrosj
4 months ago

  • Milestone changed from 5.2 to 5.3

Still needs further investigation. Punting to 5.3.

Note: See TracTickets for help on using tickets.