X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=www%2Fplugins-dist%2Fsquelettes_par_rubrique%2Fsquelettes_par_rubrique_options.php;h=e8668e34ad379e8f5764a03102f6dda896cd8a17;hb=f489d45ae677afde12ba9c9f70f463ea34787b45;hp=bbf3b77d8d22b7f07345af88d229ef4b61d9837d;hpb=0dda6af18a04031b1ca8e217187966077e752fe3;p=ptitvelo%2Fweb%2Fwww.git diff --git a/www/plugins-dist/squelettes_par_rubrique/squelettes_par_rubrique_options.php b/www/plugins-dist/squelettes_par_rubrique/squelettes_par_rubrique_options.php index bbf3b77..e8668e3 100644 --- a/www/plugins-dist/squelettes_par_rubrique/squelettes_par_rubrique_options.php +++ b/www/plugins-dist/squelettes_par_rubrique/squelettes_par_rubrique_options.php @@ -36,6 +36,7 @@ function squelettes_par_rubrique_styliser_par_rubrique($flux) { if (@file_exists("$f.$ext")) $squelette = $f; else { + $maxiter = 10000; // on ne remonte pas au dela en profondeur // fond-10 fond- do { $f = "$squelette-$id_rubrique"; @@ -43,7 +44,12 @@ function squelettes_par_rubrique_styliser_par_rubrique($flux) { $squelette = $f; break; } - } while ($id_rubrique = quete_parent($id_rubrique)); + } while ( + $maxiter-- + AND $id_rubrique = quete_parent($id_rubrique) + // se proteger des references circulaires + AND $id_rubrique != $flux['args']['id_rubrique'] + ); } // sauver le squelette $flux['data'] = $squelette;