标签:function 很多 pass 部分 string class decode blacklist style
// If we have a valid target, let‘s load that script instead if (! empty($_REQUEST[‘target‘]) && is_string($_REQUEST[‘target‘]) && ! preg_match(‘/^index/‘, $_REQUEST[‘target‘]) && ! in_array($_REQUEST[‘target‘], $target_blacklist) && Core::checkPageValidity($_REQUEST[‘target‘]) ) { include $_REQUEST[‘target‘]; exit; }
/index.php //line 50-52 $target_blacklist = array ( ‘import.php‘, ‘export.php‘ );
//443-478 public static function checkPageValidity(&$page, array $whitelist = []) { if (empty($whitelist)) { $whitelist = self::$goto_whitelist; } if (! isset($page) || !is_string($page)) { return false; } if (in_array($page, $whitelist)) { return true; } $_page = mb_substr( $page, 0, mb_strpos($page . ‘?‘, ‘?‘) ); if (in_array($_page, $whitelist)) { return true; } $_page = urldecode($page); $_page = mb_substr( $_page, 0, mb_strpos($_page . ‘?‘, ‘?‘) ); if (in_array($_page, $whitelist)) { return true; } return false; }
public static $goto_whitelist = array( ‘db_datadict.php‘, ‘db_sql.php‘, ‘db_events.php‘, ‘db_export.php‘, ‘db_importdocsql.php‘, ‘db_multi_table_query.php‘, ‘db_structure.php‘, ...... ‘user_password.php‘, );
$_page = mb_substr( $page, 0, mb_strpos($page . ‘?‘, ‘?‘) ); if (in_array($_page, $whitelist)) { return true; }
标签:function 很多 pass 部分 string class decode blacklist style
原文地址:https://www.cnblogs.com/yichen115/p/11313084.html