WordPress.org

Make WordPress Core

Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#43645 closed defect (bug) (duplicate)

WP 4.9.4 removes !function_exists check for "__" in wp-includes/l10n.php

Reported by: boland Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: I18N Keywords:
Focuses: Cc:
PR Number:

Description

I ran into this issue while working on a site where WordPress handles the front-end and CakePHP runs in the background to handle some js application outputs.

CakePHP also defines a

__()

translation function in its global scope, removing the

if(!function_exists('__'))

check on the translation function in wp-includes/l10n.php causes a fatal redeclaration error when both system cores are loaded on a request.

Was there a reason this check was removed?

Change History (2)

#1 @SergeyBiryukov
19 months ago

  • Component changed from General to I18N
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @boland, welcome to WordPress Trac! Thanks for the report.

WordPress never checked for __() existence, so it looks like someone had manually edited the core files on your site.

This was previously raised in #41498, let's continue the discussion there.

#2 @boland
19 months ago

Thanks for that clarification @SergeyBiryukov
Turns out another dev had added that conditional check in some recent updates.

Note: See TracTickets for help on using tickets.