Make WordPress Core

Ticket #28766: hhvm_permalink_fix.diff

File hhvm_permalink_fix.diff, 3.2 KB (added by crxgames, 11 years ago)
  • wp-admin/includes/misc.php

    diff --git wp-admin/includes/misc.php wp-admin/includes/misc.php
    index 9df8805..fef68ae 100644
    function got_mod_rewrite() { 
    4141 * @return bool Whether the server supports URL rewriting.
    4242 */
    4343function got_url_rewrite() {
    44         $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() );
     44        $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || $GLOBALS['is_hhvm'] || iis7_supports_permalinks() );
    4545
    4646        /**
    4747         * Filter whether URL rewriting is available.
  • wp-admin/options-permalink.php

    diff --git wp-admin/options-permalink.php wp-admin/options-permalink.php
    index 28395e9..29ff188 100644
    if ( $iis7_permalinks ) { 
    127127                $writable = true;
    128128        else
    129129                $writable = false;
    130 } elseif ( $is_nginx ) {
     130} elseif ( $is_nginx || $is_hhvm) {
    131131        $writable = false;
    132132} else {
    133133        if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {
    if ( ! is_multisite() ) { 
    159159                        _e('Permalink structure updated. Remove write access on web.config file now!');
    160160                else
    161161                        _e('Permalink structure updated.');
    162         } elseif ( $is_nginx ) {
     162        } elseif ( $is_nginx || $is_hhvm) {
    163163                _e('Permalink structure updated.');
    164164        } else {
    165165                if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) {
    printf( __('If you like, you may enter custom structures for your category and t 
    278278<p><?php _e('If you temporarily make your site&#8217;s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p>
    279279                <?php endif; ?>
    280280        <?php endif; ?>
    281 <?php elseif ( ! $is_nginx ) :
     281<?php elseif ( ! $is_nginx  && ! $is_hhvm) :
    282282        if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) : ?>
    283283<p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
    284284<form action="options-permalink.php" method="post">
  • wp-includes/vars.php

    diff --git wp-includes/vars.php wp-includes/vars.php
    index 996d173..7477b36 100644
     
    1717
    1818global $pagenow,
    1919        $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE,
    20         $is_apache, $is_IIS, $is_iis7, $is_nginx;
     20        $is_apache, $is_IIS, $is_iis7, $is_nginx, $is_hhvm;
    2121
    2222// On which page are we ?
    2323if ( is_admin() ) {
    $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos( 
    104104$is_nginx = (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false);
    105105
    106106/**
     107 * Whether the server software is HHVM or something else
     108 * @global bool $is_hhvm
     109 */
     110$is_hhvm = (strpos($_SERVER['SERVER_SOFTWARE'], 'HPHP') !== false);
     111
     112/**
    107113 * Whether the server software is IIS or something else
    108114 * @global bool $is_IIS
    109115 */