[kde-doc-english] docs.kde.org issues

Burkhard Lück lueck at hube-lueck.de
Tue Jan 31 14:35:55 UTC 2012


Am Samstag, 14. Januar 2012, 11:53:08 schrieb Burkhard Lück:
> My php skills are really limited, so one question for the ignore_array in 
> index.php:
> ignore_array has entries like kdepim/kioslave, but these are nevertheless 
> visible on d.k.o.
> 
> This code snippet from index.php should exclude them, but apparently does
> not  work for entries like "kdepim/kioslave" as I expect it:
> 
>         /* Ignore the oddities defined above */
>                 foreach ( $ignore_array as $ignore_string ) {
>                         $test_string = $selected_package . "/" .
> $application;   if ( $test_string == $ignore_string ) {
>                                 $breaktest = true;
>                                 break;
>                         } else {
>                                 $breaktest = false;
>                         }
>                 }
>         
> Any ideas to fix that?

With $ignore_array[] = "kdelibs/kioslave"
and 
$selected_package="kdelibs"
$application="kioslave/ftp"
this afaik compares
"kdelibs/kioslave"=="kdelibs/kioslave/ftp"
which is False, so all subdirs of kdelibs/kioslave are NOT ignored, but 
should.

May be to check if test_string contains ignore_string like
$pos = strpos($ignore_string,$test_string);
if($pos === true) {
  //  IN ignore_array
  $breaktest = true;
  break;
} else {
  // NOT IN ignore_array
  $breaktest = false;
}
does work here as expected (ignore "kdelibs/kioslave" with all its subdirs 
completely) ?

Thanks.

-- 
Burkhard Lück


More information about the kde-doc-english mailing list