diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-06-06 11:39:11 -0700 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-06 11:39:11 -0700 |
| commit | 5835715e49f98943c561d6cee67840488c428175 (patch) | |
| tree | 4a48034bc1f3e4b279b8791dbc7c30b5d21f8cac /modules/gallery/tests | |
| parent | ab1fc6ad533968ac7cb1d0506e989f549935b7aa (diff) | |
| parent | cd92b2ed85f063d990412601c19eeed1783be7c4 (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/tests')
| -rw-r--r-- | modules/gallery/tests/Xss_Security_Test.php | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/modules/gallery/tests/Xss_Security_Test.php b/modules/gallery/tests/Xss_Security_Test.php index 03151c8c..e179482c 100644 --- a/modules/gallery/tests/Xss_Security_Test.php +++ b/modules/gallery/tests/Xss_Security_Test.php @@ -18,41 +18,9 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Xss_Security_Test extends Unit_Test_Case { - - static function scan_php_file($file, &$cache) { - $code = file_get_contents($file); - $raw_tokens = token_get_all($code); - unset($code); - - $tokens = array(); - $func_token_list = array("t" => array(), "t2" => array()); - $token_number = 0; - // Filter out HTML / whitespace, and build a lookup for global function calls. - foreach ($raw_tokens as $token) { - if ((!is_array($token)) || (($token[0] != T_WHITESPACE) && ($token[0] != T_INLINE_HTML))) { - if (is_array($token)) { - if ($token[0] == T_STRING && in_array($token[1], array("t", "t2"))) { - $func_token_list[$token[1]][] = $token_number; - } - } - $tokens[] = $token; - $token_number++; - } - } - unset($raw_tokens); - - if (!empty($func_token_list["t"])) { - l10n_scanner::_parse_t_calls($tokens, $func_token_list["t"], $cache); - } - if (!empty($func_token_list["t2"])) { - l10n_scanner::_parse_plural_calls($tokens, $func_token_list["t2"], $cache); - } - } - public function find_unescaped_variables_in_views_test() { foreach (glob("*/*/views/*.php") as $view) { $expr = null; - $line = null; $level = 0; $php = 0; $str = null; |
