• Resolved Stefan M.

    (@stefan-m-1)


    Many issues where Ninja Firewall cannot read the config correctly..

    Most likly issue is:

    $table_prefix is working.
    ${table_prefix} is not working.

    As wordpress recommended including {} in the past, its better to add the {} stuff within the regex to find the variable.

    Devs, can you please implement that?

    https://www.ads-software.com/plugins/ninjafirewall/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Hi,

    The recommendation applies to your code only, not to your config file.
    Because the prefix is always appended to the table name, it is only used to instruct PHP where the variable name ends. For instance:

    <?php
    $table_prefix  = 'wp_';
    
    echo "${table_prefix}options\n";
    echo "{$table_prefix}options\n";
    echo "${'table_prefix'}options\n";

    All will echo ‘wp_options’.

    But there is no need to modify the syntax of a variable with brackets when you declare it in your wp-config.php script, it is of no use as there is no string concatenation.
    And both PHP and NinjaFirewall will have less work to do that way than if we had to code a regex that could match the above three possibilities.

    Thread Starter Stefan M.

    (@stefan-m-1)

    When within the wp-config.php

    ${table_prefix} = “something”;

    if used, the Ninja Firewall shows an error “Configuration not found…
    Yes, your code is correct, except that Ninja have a regex that doesn’t recognise the var above and shows an error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘table_prefix issue’ is closed to new replies.