[SPIP Zone] r4704 - /_plugins_branche_stable_/_spip_1_9_0_/ancres_intertitres/ancres_intertitres.php

Author: james@rezo.net
Date: Sat Aug 19 02:44:39 2006
New Revision: 4704

Log:
au lit

Modified:
    _plugins_branche_stable_/_spip_1_9_0_/ancres_intertitres/ancres_intertitres.php

Modified: _plugins_branche_stable_/_spip_1_9_0_/ancres_intertitres/ancres_intertitres.php

--- _plugins_branche_stable_/_spip_1_9_0_/ancres_intertitres/ancres_intertitres.php (original)
+++ _plugins_branche_stable_/_spip_1_9_0_/ancres_intertitres/ancres_intertitres.php Sat Aug 19 02:44:39 2006
@@ -1,12 +1,13 @@
<?php

-//
-// http://www.spip-contrib.net/spikini/VarianteContribAjouter-des-ID-aux-intertitres
-//
+ define("_LG_ANCRE", 35);

   function AncresIntertitres_ancres_intertitres($texte) {
- $regexp = "/{{{[[:space:]]*(.+)[[:space:]]*}}}/";
- $texte = preg_replace_callback($regexp, create_function('$matches','return AncresIntertitres_remplace_intertitre($matches);'), $texte);
+ $regexp = "/{{{[[:space:]]*(.+)[[:space:]]*}}}/S";
+ $texte = preg_replace_callback($regexp,
+ create_function('$matches',
+ 'return AncresIntertitres_remplace_intertitre($matches);'),
+ $texte);
     return $texte;
   }
   
@@ -27,7 +28,7 @@
       foreach ($mots as $mot) {
         if (!$mot) continue;
         $url2 = $url.'-'.$mot;
- if (strlen($url2) > 35) {
+ if (strlen($url2) > _LG_ANCRE) {
           break;
         }
       $url = $url2;