Make WordPress Core

Opened 16 months ago

Closed 15 months ago

Last modified 12 months ago

#23093 closed enhancement (fixed)

Slight patch for load.php to avoid install warnings

Reported by: dfavor Owned by: nacin
Milestone: 3.6 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:


Installing where the php '@' (shut-up operator) is disabled, load.php throws a warning.

Attached is a patch for a fix.

Patch file instructions appear to suggest 'diff -up original change', so that's the patch format.

If another format is preferred, let me know and I'll resubmit the patch.

Attachments (2)

23093.diff (590 bytes) - added by dfavor 16 months ago.
Patch wp-includes/load.php to avoid warning during install when php '@' shut-up is disabled
23093.2.diff (508 bytes) - added by nacin 15 months ago.

Download all attachments as: .zip

Change History (13)

dfavor16 months ago

Patch wp-includes/load.php to avoid warning during install when php '@' shut-up is disabled

comment:1 nacin16 months ago

  • Milestone changed from Awaiting Review to 3.6

comment:2 dfavor16 months ago

While this fix is under review, describe the best way to set $blog_charset to avoid this warning.


comment:3 dfavor16 months ago

Someone me know if there's something I can add to wp-config.php to resolve this warning.


comment:4 dfavor15 months ago


comment:5 nacin15 months ago

I don't see in the PHP documentation (http://php.net/mb_internal_encoding) under what circumstances mb_internal_encoding() triggers a warning. I'm also not familiar when blog_charset is empty. If it were, that seems like it would break an awful number of charset declarations. In general, the existing function seems fairly confusing and I don't know the code's history.

comment:6 nacin15 months ago

Ok — looking at the PHP source, mb_internal_encoding() returns a warning for unknown encodings. So, the @ is still necessary. We just need to avoid the warning during install.

comment:7 SergeyBiryukov15 months ago

Related: #6092

23093.diff essentially reverts [7157].

comment:8 dfavor15 months ago

Yes. This is correct. The warning only shows up when the shut-up operator is turned off,
which is essential for maintaining an error/warning free runtime environment.

Leaving the shut-up operator on masks all sorts of ugly errors that cause Wordpress
to whitescreen.

nacin15 months ago

comment:9 nacin15 months ago

We still need to suppress a warning for when blog_charset — however improbable that may be — is an invalid encoding. See 23093.2.diff.

comment:10 nacin15 months ago

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

In 23373:

Ensure we have a charset before calling mb_internal_encoding(), avoiding an unnecessary (if suppressed) warning. props dfavor. fixes #23093.

comment:11 dfavor12 months ago


This will also allow wp-cli to do error free Wordpress installs on the command line.

Thanks Niacin!

Note: See TracTickets for help on using tickets.