Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#44865 closed enhancement (fixed)

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

Reported by: naghmesara's profile naghmesara Owned by: ocean90's profile ocean90
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 (7)

#1 @naghmesara
6 years ago

  • Focuses rtl added

#2 @SergeyBiryukov
6 years 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
6 years ago

  • Milestone changed from 5.0 to 5.1

#4 @desrosj
6 years 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
6 years ago

  • Milestone changed from 5.2 to 5.3

Still needs further investigation. Punting to 5.3.

#6 @ocean90
5 years ago

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

In 45688:

I18N: Use RTL stylesheets when running from /src.

To run WordPress from /src you have to use the --dev flag which also builds the RTL stylesheets thus the admin notice and force to LTR is no longer required.

See #44492.
Fixes #44865.

#7 @ocean90
5 years ago

In 45689:

I18N: Following [45688], remove test for removed method.

See #44865.

Note: See TracTickets for help on using tickets.