diff options
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r-- | modules/gallery/tests/Xss_Security_Test.php | 32 | ||||
-rw-r--r-- | modules/gallery/tests/xss_data.txt | 5 |
2 files changed, 3 insertions, 34 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; diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 04dbd23b..e3dbb188 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -279,7 +279,7 @@ modules/gallery/views/simple_uploader.html.php 30 $item->ti modules/gallery/views/simple_uploader.html.php 77 DIRTY $item->id modules/gallery/views/simple_uploader.html.php 81 DIRTY $csrf modules/image_block/views/image_block_block.html.php 3 DIRTY $item->url() -modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_image(array("class" => "gThumbnail")) +modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class" => "gThumbnail")) modules/info/views/info_block.html.php 6 $item->title modules/info/views/info_block.html.php 11 $item->description modules/info/views/info_block.html.php 17 $item->name @@ -492,6 +492,7 @@ themes/admin_default/views/admin.html.php 31 DIRTY $theme->a themes/admin_default/views/admin.html.php 35 DIRTY $theme->admin_page_top() themes/admin_default/views/admin.html.php 41 DIRTY $theme->site_status() themes/admin_default/views/admin.html.php 43 DIRTY $theme->admin_header_top() +themes/admin_default/views/admin.html.php 46 DIRTY $csrf themes/admin_default/views/admin.html.php 50 DIRTY $theme->admin_menu() themes/admin_default/views/admin.html.php 52 DIRTY $theme->admin_header_bottom() themes/admin_default/views/admin.html.php 58 DIRTY $theme->messages() @@ -612,7 +613,7 @@ themes/default/views/photo.html.php 32 DIRTY $item->re themes/default/views/photo.html.php 36 DIRTY $theme->resize_bottom($item) themes/default/views/photo.html.php 40 $item->title themes/default/views/photo.html.php 41 $item->description -themes/default/views/photo.html.php 44 DIRTY $theme->photo_bottom() +themes/default/views/photo.html.php 47 DIRTY $theme->photo_bottom() themes/default/views/sidebar.html.php 2 DIRTY $theme->sidebar_top() themes/default/views/sidebar.html.php 6 DIRTY $theme->album_menu() themes/default/views/sidebar.html.php 8 DIRTY $theme->photo_menu() |