Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#44865 closed enhancement (fixed)

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

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

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
8 years ago

  • Focuses rtl added

#2 @SergeyBiryukov
8 years ago

  • Component GeneralI18N
  • Milestone Awaiting Review5.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
8 years ago

  • Milestone 5.05.1

#4 @desrosj
8 years ago

  • Milestone 5.15.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
7 years ago

  • Milestone 5.25.3

Still needs further investigation. Punting to 5.3.

#6 @ocean90
7 years ago

  • Owner set to ocean90
  • Resolutionfixed
  • Status newclosed

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
7 years ago

In 45689:

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

See #44865.

Note: See TracTickets for help on using tickets.