• Tim Bowen

    (@creativeslice)


    There is a problem with a relative link to the wp-config file. To fix this modify line 8 in wordspew.php and line 19 in wordspew_admin.php

    BAD Code:
    $html = implode('', file("../../../wp-config.php"));

    GOOD Code:
    $html = implode('', file(get_bloginfo('wpurl')."/wp-config.php"));

    http://wordpress.org/extend/plugins/pierres-wordspew/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin developers need to make sure to link to WP files using bloginfo(‘wpurl’). As WP gets more modular and configurable, it is important for developers to be sure they are using the provided modular, configurable variables.

    In this case if a user installs in a directory, the wp-config file was no longer available to the plugin since the path was hard-coded.

    Nice catch. Fixed it for me. 🙂

    Thread Starter Tim Bowen

    (@creativeslice)

    Turns out the better way is to replace the if statement on both those files with this:

    if (!isset($table_prefix)) {
    	$html = file_get_contents("../../../wp-config.php");
    	$html = str_replace("require_once", "// ", $html);
    	$html = str_replace("<?php", "", $html);
    	eval($html);
    }

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Pierre’s Wordspew] wp-config fix’ is closed to new replies.