General: Fix various issues flagged by the PHPCompatibilityWP PHPCS ruleset.

As part of the continued effort to improve PHP compatibility, the following improvments are being made:

- Removing deprecated PHP `safe_mode` checks not found in bundled external libraries.
- Change the remaining `while` loops using `each()` to `foreach` loops.
- Prevent false positives from being flagged for the `sodium_compat` library being caused by loading this in a non-standard way.
- Add inline comments to not flag deprecated PHP directives in the getID3 library.

Props desrosj, earnjam, dryanpress.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47735 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2020-05-01 19:05:04 +00:00
parent 05423578d7
commit 8e2de8212b
4 changed files with 35 additions and 26 deletions
+1 -8
View File
@@ -369,13 +369,6 @@ function populate_options( array $options = array() ) {
*/
do_action( 'populate_options' );
if ( ini_get( 'safe_mode' ) ) {
// Safe mode can break mkdir() so use a flat structure by default.
$uploads_use_yearmonth_folders = 0;
} else {
$uploads_use_yearmonth_folders = 1;
}
// If WP_DEFAULT_THEME doesn't exist, fall back to the latest core default theme.
$stylesheet = WP_DEFAULT_THEME;
$template = WP_DEFAULT_THEME;
@@ -466,7 +459,7 @@ function populate_options( array $options = array() ) {
'db_version' => $wp_db_version,
// 2.0.1
'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders,
'uploads_use_yearmonth_folders' => 1,
'upload_path' => '',
// 2.1