WordPress.org

Ready to get started?Download WordPress

Forums

Bug: Plugin replaced my theme's 404 file (2 posts)

  1. pmdci
    Member
    Posted 6 years ago #

    The plugin is in theory really cool. But it really enraged me when it replaced my 404.php file for my theme without my consent.

  2. AskApache
    Member
    Posted 6 years ago #

    That is incorrect. It is impossible for this plugin to replace your 404.php, here is the code to prove it.

    function aa_google_404_activate(){
    	global $aa_G404;
    
    	if ( !file_exists(TEMPLATEPATH.'/404.php')){
    		if (!copy(dirname(__FILE__).'/404.php', TEMPLATEPATH.'/404.php'))$aa_status.='<div id="message" class="error fade"><p><strong>ERROR:</strong>Attempt to create 404.php FAILED!</p></div>';
    		else $aa_status.='<div id="message" class="updated fade"><p><strong>Message:</strong>Attempt to create 404.php SUCCESS!</p></div>';
    	}else {
    		$the_404_data = implode( '', file( TEMPLATEPATH.'/404.php' ));
    		if (false!==($aa_temp=strpos($the_404_data,'AskApache'))){
    			unlink(TEMPLATEPATH.'/404.php');
    			if (!copy(dirname(__FILE__).'/404.php', TEMPLATEPATH.'/404.php'))$aa_status.='<div id="message" class="error fade"><p><strong>ERROR:</strong>Attempt to create 404.php FAILED!</p></div>';
    			else $aa_status.='<div id="message" class="updated fade"><p><strong>Message:</strong>Attempt to create 404.php SUCCESS!</p></div>';
    		}
    	}

    What most likely happened is that your blog was using your basic index.php for your theme because you didn't have a 404.php file in your templates folder.

    Sorry for the confusion, the next version will make this optional.

Topic Closed

This topic has been closed to new replies.

About this Topic