I have a couple questions about one of the pages I am trying to rewrite.
As an example I have "magic_quotes" and need to find an alternative to them.
$PHP = explode( ".", phpversion( ) );
$g['php'] = $PHP[0];
$g['php2'] = $PHP[1];
if ( $g['php'] == 5 && function_exists( "date_default_timezone_set" ) )
{
@date_default_timezone_set( @date_default_timezone_get( ) );
}
set_magic_quotes_runtime( false );
if ( !isset( $g['to_root'] ) )
{
$g['to_root'] = "../";
}
Another line using magic quotes:
@set_magic_quotes_runtime( @false );
include_once( $g['to_root']."_include/lib/lib.php" );
if ( !null !==( $g['error_output'] ) )
{
$g['error_output'] = "browser";
}
error_reporting( E_ALL );
I am aware the magic_quotes have been removed, but I need to work around this type of scenario when I find them within this code.
I also have a question about "isset" which is also deprecated. I have found that changing it to use "null !==" is its placement according to the php manual, but what I am trying to learn is the following.
if ( !isset( $g['error_output'] ) )
If there is an exclamation "!" before the instruction, what is it stating? From what I have been reading it is a logical "NOT" operator so which should return a the reverse of the equations function. If True, then show false and vise versa. Is this correct?
The other side to this is how do I write the line without the !isset to get the same function. Surely ! null !== is not the correct structure to do this.