mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_help.pm: better regex handling
git-svn-id: https://svn.fhem.de/fhem/trunk@24896 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4d99159afa
commit
d8ac681e86
@ -39,7 +39,7 @@ sub CommandHelp {
|
|||||||
my $modPath = AttrVal('global','modpath','.');
|
my $modPath = AttrVal('global','modpath','.');
|
||||||
my $output = '';
|
my $output = '';
|
||||||
|
|
||||||
my $outputInfo = cref_findInfo($modPath,$mod);
|
my $outputInfo = cref_findInfo($modPath,$mod,$cl);
|
||||||
|
|
||||||
if($cmds{help}{InternalCmds} !~ m/(^|\,)$mod\,/) {
|
if($cmds{help}{InternalCmds} !~ m/(^|\,)$mod\,/) {
|
||||||
my %mods;
|
my %mods;
|
||||||
@ -260,7 +260,7 @@ sub cref_fill_list(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub cref_findInfo {
|
sub cref_findInfo {
|
||||||
my ($modPath,$mod) = @_;
|
my ($modPath,$mod,$cl) = @_;
|
||||||
my ($l,@line,$found,$text);
|
my ($l,@line,$found,$text);
|
||||||
my ($err,@text) = FileRead({FileName => "$modPath/MAINTAINER.txt", ForceType => 'file'});
|
my ($err,@text) = FileRead({FileName => "$modPath/MAINTAINER.txt", ForceType => 'file'});
|
||||||
foreach my $l (@text) {
|
foreach my $l (@text) {
|
||||||
@ -272,7 +272,7 @@ sub cref_findInfo {
|
|||||||
if($found) {
|
if($found) {
|
||||||
$line[0]= (split("/",$line[0]))[1] if $line[0] =~ /\//;
|
$line[0]= (split("/",$line[0]))[1] if $line[0] =~ /\//;
|
||||||
if (defined($line[2])) {
|
if (defined($line[2])) {
|
||||||
$line[2] =~ s/\s*http.*//i;
|
$line[2] =~ s/\s*http.*/(link removed for security reasons)/i if ($cl->{TYPE} eq 'FHEMWEB');
|
||||||
} else {
|
} else {
|
||||||
$line[2] = 'no info';
|
$line[2] = 'no info';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user