A Funny Challenge About Pass a PHP Script

I got a funny challenge from securityoverride.org’s Advanced Level 1.
The challenge is a section of PHP Script.
Following is the script:
<?php
$input = trim(getUserInput());
if(
str_split($input) == array(0,0,0,0) ||
strcmp($input, “0000”) == 0 ||
strcmp($input, “000”) == 0 ||
strcmp($input, “00”) == 0 ||
strcmp($input, “0”) == 0 ||
$input === 0 ||
preg_match(“/^[\d]{1,}$/D”, $input)
)fail_advanced_1();
if($input == “0000”) complete_advanced_1();
?>
After a long time thinking,I found that a different equation”$input === 0“,which means Strict comparisons!!!!
So we just need to input “-0″(negative 0)to pass the script!
发表评论