From: Moritz Bunkus Date: Fri, 21 Jan 2011 14:43:56 +0000 (+0100) Subject: Merge branch 'master' of lx-office.linet-services.de:lx-office-erp X-Git-Tag: release-2.6.2beta2^0 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/6618641eb6561393c1a35d93db61d3bb4bbea402?hp=db4d80803649329a1a12cbbd7cfefa72aa75d141 Merge branch 'master' of lx-office.linet-services.de:lx-office-erp --- diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index da7ffef64..2f239524f 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -5,7 +5,6 @@ use strict; BEGIN { unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. - push @INC, "SL"; # FCGI won't find modules that are not properly named. Help it by inclduging SL } use CGI qw( -no_xhtml); @@ -15,8 +14,8 @@ use SL::Auth; use SL::LXDebug; use SL::Locale; use SL::Common; +use SL::Form; use SL::Helper::DateTime; -use Form; use List::Util qw(first); use File::Basename; diff --git a/t/007broken_links.t b/t/007broken_links.t new file mode 100644 index 000000000..ee0021ef8 --- /dev/null +++ b/t/007broken_links.t @@ -0,0 +1,42 @@ +#!/usr/bin/perl + +# adapted from Michael Stevens' test script posted in p5p +# in the thread "broken links in blead" from 01/19/2011 +# +# caveats: wikipedia seems to have crawler protection and +# will give 403 forbidden unless the user agent is faked. + +use strict; +use File::Find; +use LWP::Simple; +use Test::More tests => 1; +use URI::Find; + +my @fails; + +my $finder = URI::Find->new(sub { + my ($uri_obj, $uri_text) = @_; + $uri_text =~ s/^\$//; + + push @fails, "$uri_text in file $File::Find::name" + if !defined get($uri_text); + + return $_[1]; +}); + +find(sub { + open(FH, $File::Find::name) or return; + my $text; + { local $/; $text = ; } + + $finder->find(\$text); + + }, "." +); + +if (@fails) { + ok(0, join "\n", @fails); +} else { + ok(1, "no broken links found"); +}