colas@0: # colas@0: # TWiki Enterprise Collaboration Platform, http://TWiki.org/ colas@0: # colas@0: # Copyright (C) 2000-2006 TWiki Contributors. colas@0: # colas@0: # This program is free software; you can redistribute it and/or colas@0: # modify it under the terms of the GNU General Public License colas@0: # as published by the Free Software Foundation; either version 2 colas@0: # of the License, or (at your option) any later version. For colas@0: # more details read LICENSE in the root of this distribution. colas@0: # colas@0: # This program is distributed in the hope that it will be useful, colas@0: # but WITHOUT ANY WARRANTY; without even the implied warranty of colas@0: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. colas@0: # colas@0: # As per the GPL, removal of this notice is prohibited. colas@0: package TWiki::Configure::Checkers::ScriptSuffix; colas@0: colas@0: use strict; colas@0: colas@0: use TWiki::Configure::Checker; colas@0: colas@0: use base 'TWiki::Configure::Checker'; colas@0: colas@0: sub check { colas@0: my $this = shift; colas@0: colas@0: # SMELL: should check to see what the extension on _this_ script colas@0: # is, and generate a helpful message colas@0: if ( defined $TWiki::cfg{ScriptSuffix} && $TWiki::cfg{ScriptSuffix} ne '' ) { colas@0: if ( ! $TWiki::query->path_info() =~ /$TWiki::cfg{ScriptSuffix}$/ ) { colas@0: return $this->ERROR('this script ('.$TWiki::query->path_info().') called with different ScriptSuffix setting'.$TWiki::cfg{ScriptSuffix}); colas@0: } colas@0: } colas@0: return ''; colas@0: } colas@0: colas@0: 1;