Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

Call to a member function using_index_permalinks() on null #446

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

nigrosimone
Copy link
Collaborator

@nigrosimone nigrosimone commented Mar 22, 2017

From official forum https://wordpress.org/support/topic/fatal-error-util_pageurls-php/

Fatal error: Call to a member function using_index_permalinks() on null in /data/www/14157/kosmonautix_cz/wp-content/plugins/w3-total-cache/Util_PageUrls.php on line 503

w3tc doesn't check if global $wp_rewrite;is initialized:

if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
    $base .= 'index.php/';

My fix is a simple check

if ( !is_null($wp_rewrite) && $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
    $base .= 'index.php/';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant