Overview
Comment:Corrections liens wiki
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0bcba85e3bf9b3d34b0fc2db3e2581f450de5ef1
User & Date: bohwaz on 2014-01-20 00:34:43
Other Links: manifest | tags
Context
2014-01-27
17:06
Mise à jour 0.6 avec début transactions/activités/cotisations check-in: 4d7949c651 user: bohwaz tags: trunk
2014-01-20
00:34
Corrections liens wiki check-in: 0bcba85e3b user: bohwaz tags: trunk
00:27
suppression de tirets au début ou à la fin de l'url check-in: 6249bd62de user: bohwaz tags: trunk
Changes

Modified src/include/lib.template.php from [b15486d91d] to [b7a6d505ca].

   181    181       $str = utils::htmlSpip($str);
   182    182       $str = utils::htmlGarbage2xhtml($str);
   183    183       return $str;
   184    184   }
   185    185   
   186    186   function tpl_liens_wiki($str, $prefix)
   187    187   {
   188         -    return preg_replace_callback('!<a href="([^/.]+)">!i', function ($matches) use ($prefix) {
          188  +    return preg_replace_callback('!<a href="([^/.:@]+)">!i', function ($matches) use ($prefix) {
   189    189           return '<a href="' . $prefix . Wiki::transformTitleToURI($matches[1]) . '">';
   190    190       }, $str);
   191    191   }
   192    192   
   193    193   function tpl_pagination($params)
   194    194   {
   195    195       if (!isset($params['url']) || !isset($params['page']) || !isset($params['bypage']) || !isset($params['total']))

Modified src/include/lib.utils.php from [4548303020] to [cd368939e7].

   369    369               self::$g2x = new \garbage2xhtml;
   370    370               self::$g2x->core_attributes = array('class', 'id', 'title');
   371    371           }
   372    372   
   373    373           return self::$g2x->process($str);
   374    374       }
   375    375   
   376         -    static public function htmlSpip($str)
          376  +    static public function htmlSpip($str, $prefix = '')
   377    377       {
   378    378           // Intertitres
   379    379           $str = preg_replace('/(?<!\\\\)\{{3}(\V*)\}{3}/', '<h3>$1</h3>', $str);
   380    380   
   381    381           // Gras
   382    382           $str = preg_replace('/(?<!\\\\)\{{2}(\V*)\}{2}/', '<strong>$1</strong>', $str);
   383    383   
................................................................................
   385    385           $str = preg_replace('/(?<!\\\\)\{(\V*)\}/', '<em>$1</em>', $str);
   386    386   
   387    387           // Espaces typograhiques
   388    388           $str = preg_replace('/\h*([?!;:»])(\s+|$)/u', '&nbsp;$1$2', $str);
   389    389           $str = preg_replace('/(^|\s+)([«])\h*/u', '$1$2&nbsp;', $str);
   390    390   
   391    391           // Liens
   392         -        $str = preg_replace('/(?<!\\\\)\[([^-]+)->([^\]]+)\]/', '<a href="$2">$1</a>', $str);
   393         -        $str = preg_replace('/(?<!\\\\)\[([^\]]+)\]/', '<a href="$1">$1</a>', $str);
          392  +        $str = preg_replace('/(?<!\\\\)\[(.+?)->(.+?)\]/', '<a href="$2">$1</a>', $str);
          393  +        $str = preg_replace('/(?<!\\\\)\[(.+?)\]/', '<a href="$1">$1</a>', $str);
   394    394   
          395  +        // Adresses email
   395    396           $str = preg_replace('/<a href="((?!http).*@.*)">/iU', '<a href="mailto:$1">', $str);
   396    397   
   397    398           return $str;
   398    399       }
   399    400   
   400    401       static public function mail($to, $subject, $content, $additional_headers = array())
   401    402       {

Modified src/templates/admin/index.tpl from [3ef801d675] to [eaecc4ec22].

    25     25           {if empty($user.date_cotisation)}<b class="error">jamais réglée</b>
    26     26           {elseif $verif_cotisation === true}<b class="confirm">À jour :-)</b>
    27     27           {else}<b class="alert">En retard !</b>{/if}
    28     28       </li>
    29     29   </ul>
    30     30   
    31     31   <div class="wikiContent">
    32         -    {$page.contenu.contenu|format_wiki|liens_wiki:'?'}
           32  +    {$page.contenu.contenu|format_wiki|liens_wiki:'wiki/?'}
    33     33   </div>
    34     34   
    35     35   {include file="admin/_foot.tpl"}