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 #445

Closed
nigrosimone opened this issue Mar 22, 2017 · 1 comment
Closed

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

nigrosimone opened this issue Mar 22, 2017 · 1 comment

Comments

@nigrosimone
Copy link
Collaborator

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/';
@nigrosimone
Copy link
Collaborator Author

merged #446

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

No branches or pull requests

1 participant