Make WordPress Core


Ignore:
Timestamp:
08/02/2020 12:49:08 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Permalinks: Simplify the logic for displaying "You should update your .htaccess file now" message.

See #39547, #50834.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-permalink.php

    r48711 r48712  
    161161    $message = __( 'Permalink structure updated.' );
    162162
    163     if ( $iis7_permalinks ) {
    164         if ( $permalink_structure && ! $using_index_permalinks && ! $writable ) {
     163    if ( $permalink_structure && ! $using_index_permalinks ) {
     164        if ( $iis7_permalinks ) {
     165            if ( ! $writable ) {
     166                $message = sprintf(
     167                    /* translators: %s: web.config */
     168                    __( 'You should update your %s file now.' ),
     169                    '<code>web.config</code>'
     170                );
     171            } else {
     172                $message = sprintf(
     173                    /* translators: %s: web.config */
     174                    __( 'Permalink structure updated. Remove write access on %s file now!' ),
     175                    '<code>web.config</code>'
     176                );
     177            }
     178        } elseif ( ! $is_nginx && $htaccess_update_required && ! $writable ) {
    165179            $message = sprintf(
    166                 /* translators: %s: web.config */
     180                /* translators: %s: .htaccess */
    167181                __( 'You should update your %s file now.' ),
    168                 '<code>web.config</code>'
    169             );
    170         } elseif ( $permalink_structure && ! $using_index_permalinks && $writable ) {
    171             $message = sprintf(
    172                 /* translators: %s: web.config */
    173                 __( 'Permalink structure updated. Remove write access on %s file now!' ),
    174                 '<code>web.config</code>'
     182                '<code>.htaccess</code>'
    175183            );
    176184        }
    177     } elseif ( ! $is_nginx && $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) {
    178         $message = sprintf(
    179             /* translators: %s: .htaccess */
    180             __( 'You should update your %s file now.' ),
    181             '<code>.htaccess</code>'
    182         );
    183185    }
    184186
Note: See TracChangeset for help on using the changeset viewer.