Opened 5 months ago

Closed 4 months ago

Last modified 4 weeks ago

#23093 closed enhancement (fixed)

Slight patch for load.php to avoid install warnings

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

Description

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 5 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 4 months ago.

Download all attachments as: .zip

Change History (13)

dfavor5 months ago

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

  • Milestone changed from Awaiting Review to 3.6

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

Thanks.

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

Thanks.

Bump.

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.

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.

Related: #6092

23093.diff essentially reverts [7157].

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.

nacin4 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.

  • 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.

Excellent...

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.