source: trunk/t/65_bug_metadata_escape.t @ 452

Last change on this file since 452 was 452, checked in by kake, 18 years ago

Require CGI.pm 2.92 to avoid escapeHTML bug.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1use CGI::Wiki::Setup::SQLite;
2use Config::Tiny;
3use Cwd;
4use OpenGuides;
5use Test::More tests => 1;
6
7eval { require DBD::SQLite; };
8my $have_sqlite = $@ ? 0 : 1;
9
10SKIP: {
11    skip "DBD::SQLite not installed - no database to test with", 1
12      unless $have_sqlite;
13
14    CGI::Wiki::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
15    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
16    my $config = Config::Tiny->new;
17    $config->{_} = {
18                     dbtype             => "sqlite",
19                     dbname             => "t/node.db",
20                     indexing_directory => "t/indexes",
21                     script_url         => "http://wiki.example.com/",
22                     script_name        => "mywiki.cgi",
23                     site_name          => "CGI::Wiki Test Site",
24                     template_path      => cwd . "/templates",
25                   };
26
27    my $guide = OpenGuides->new( config => $config );
28
29    $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { phone => "<hr><h1>hello mum</h1><hr>" } ) or die "Can't write node";
30
31    my $output = $guide->display_node(
32                                       id => "South Croydon Station",
33                                       return_output => 1,
34                                     );
35    unlike( $output, qr'<hr><h1>hello mum</h1><hr>',
36            "HTML escaped in metadata on node display" );
37}
38
Note: See TracBrowser for help on using the repository browser.