Skip to content

Commit

Permalink
Code Modernization: Remove obsolete code targeting PHP < 7.2.24.
Browse files Browse the repository at this point in the history
Follow-up to [44488], [45262], [53426], [57985].

Props ayeshrajans, jrf.
See #61574.

git-svn-id: https://develop.svn.wordpress.org/trunk@58678 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jul 5, 2024
1 parent c1154f9 commit aa11864
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions src/wp-admin/includes/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -1402,30 +1402,6 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f
);
}

// Check for an edge-case affecting PHP Maths abilities.
if (
! extension_loaded( 'sodium' ) &&
in_array( PHP_VERSION_ID, array( 70200, 70201, 70202 ), true ) &&
extension_loaded( 'opcache' )
) {
/*
* Sodium_Compat isn't compatible with PHP 7.2.0~7.2.2 due to a bug in the PHP Opcache extension, bail early as it'll fail.
* https://bugs.php.net/bug.php?id=75938
*/
return new WP_Error(
'signature_verification_unsupported',
sprintf(
/* translators: %s: The filename of the package. */
__( 'The authenticity of %s could not be verified as signature verification is unavailable on this system.' ),
'<span class="code">' . esc_html( $filename_for_errors ) . '</span>'
),
array(
'php' => PHP_VERSION,
'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
)
);
}

// Verify runtime speed of Sodium_Compat is acceptable.
if ( ! extension_loaded( 'sodium' ) && ! ParagonIE_Sodium_Compat::polyfill_is_fast() ) {
$sodium_compat_is_fast = false;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

// Don't run cron until the request finishes, if possible.
if ( PHP_VERSION_ID >= 70016 && function_exists( 'fastcgi_finish_request' ) ) {
if ( function_exists( 'fastcgi_finish_request' ) ) {
fastcgi_finish_request();
} elseif ( function_exists( 'litespeed_finish_request' ) ) {
litespeed_finish_request();
Expand Down

0 comments on commit aa11864

Please sign in to comment.