Changeset 27387 in spip-zone


Ignore:
Timestamp:
Mar 17, 2009, 11:56:16 AM (10 years ago)
Author:
patfr@…
Message:

admin_couteau_suisse.php : preg_replace_callback plutôt que preg_replace('/e')

Location:
_plugins_/_stable_/couteau_suisse
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_stable_/couteau_suisse/exec/admin_couteau_suisse.php

    r27055 r27387  
    519519        // pour la liste des docs sur spip-contrib
    520520        $contribs = isset($GLOBALS['meta']['tweaks_contribs'])?unserialize($GLOBALS['meta']['tweaks_contribs']):array();
    521         foreach($contribs as $i=>$v) $contribs[$i] = preg_replace('/@@(.*?)@@/e', "couper(_T('\\1'), 25)", $v);
     521        foreach($contribs as $i=>$v) $contribs[$i] = preg_replace_callback('/@@(.*?)@@/', 'cs_couper_25', $v);
    522522        sort($contribs);
    523523        $aide = '';
     
    586586}
    587587
     588// callback pour les contribs
     589function cs_couper_25($matches) {
     590        return couper(_T($matches[1]), 25);
     591}
     592
    588593function cs_boite_rss() {
    589594        echo debut_boite_info(true), '<p><b>'._T('couteauprive:rss_titre').'</b></p><div class="cs_boite_rss"><p>'._T('couteauprive:rss_attente').'</p><noscript>'._T('couteauprive:outil_inactif').' !</noscript></div>'
  • _plugins_/_stable_/couteau_suisse/outils/trousse_balises_fonctions.php

    r27377 r27387  
    11<?php
    22
    3 // La balise #CHR, equivalent a #EVAL{"chr(XX)"}
     3// La balise #CHR, equivalent a #EVAL{"chr(XX)"} ou #VAL{XX}|chr
    44function balise_CHR_dist($p) {
    55        if (($v = interprete_argument_balise(1,$p))!==NULL){
     
    77                $p->type = 'php';
    88        }
    9         return $p;   
     9        return $p;
    1010}
     11
    1112// La balise #BOLO
    1213// inspiree des travaux de Cyril Marion : http://www.spip-contrib.net/Balise-BOLO
Note: See TracChangeset for help on using the changeset viewer.