WordPress.org

Make WordPress Core

Ticket #47186: 47186-final-timeout.patch

File 47186-final-timeout.patch, 1.6 KB (added by paragoninitiativeenterprises, 15 months ago)
  • wp-admin/includes/file.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    11991199
    12001200        }
    12011201
     1202    if (
     1203        ! extension_loaded( 'sodium' ) &&
     1204        ! ParagonIE_Sodium_Compat::runtime_speed_test(100, 10)
     1205    ) {
     1206        $max = ini_get('max_execution_time');
     1207        if ($max > 0 && $max < 60) {
     1208            // This cannot be performed in a reasonable amount of time
     1209            // https://github.com/paragonie/sodium_compat#help-sodium_compat-is-slow-how-can-i-make-it-fast
     1210
     1211            return new WP_Error(
     1212                'signature_verification_unsupported',
     1213                sprintf(
     1214                /* translators: 1: The filename of the package. */
     1215                    __('The authenticity of %1$s could not be verified as signature verification is unavailable on this system.'),
     1216                    '<span class="code">' . esc_html($filename_for_errors) . '</span>'
     1217                ),
     1218                array(
     1219                    'php' => phpversion(),
     1220                    'sodium' => defined('SODIUM_LIBRARY_VERSION') ? SODIUM_LIBRARY_VERSION : (defined('ParagonIE_Sodium_Compat::VERSION_STRING') ? ParagonIE_Sodium_Compat::VERSION_STRING : false),
     1221                    'polyfill-is-fast' => false,
     1222                    'max-execution-time' => $max
     1223                )
     1224            );
     1225        }
     1226    }
     1227
    12021228        if ( ! $signatures ) {
    12031229                return new WP_Error(
    12041230                        'signature_verification_no_signature',