Changeset 28862


Ignore:
Timestamp:
06/29/14 23:13:14 (5 years ago)
Author:
mistic100
Message:

update regexes

Location:
extensions/plugin_lang_analysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/plugin_lang_analysis/include/functions.inc.php

    r26059 r28862  
    103103  { 
    104104    // l10n 
    105     if (preg_match_all('#l10n\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
     105    if (preg_match_all('#l10n\\(\s*["\']{1}(.*?)["\']{1}\s*[,)]{1}#', $line, $matches)) 
    106106    { 
    107107      for ($j=0; $j<count($matches[1]); ++$j) 
     
    111111    } 
    112112    // translate 
    113     if (preg_match_all('#\{(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1})\|(?:@{0,1})translate#', $line, $matches)) 
     113    if (preg_match_all('#\\{\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}\\|@?translate#', $line, $matches)) 
    114114    { 
    115115      for ($j=0; $j<count($matches[1]); ++$j) 
     
    119119    } 
    120120    // translate_dec 
    121     if (preg_match_all('#translate_dec:(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1}):(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1})}#', $line, $matches)) 
     121    if (preg_match_all('#translate_dec:\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}:\\\\{0,1}["\']{1}(.*?)\\\\{0,1}["\']{1}}#', $line, $matches)) 
    122122    { 
    123123      for ($j=0; $j<count($matches[1]); ++$j) 
     
    128128    } 
    129129    // l10n_dec on one line 
    130     if (preg_match_all('#l10n_dec\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})(?:\s*),(?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
     130    if (preg_match_all('#l10n_dec\\(\s*["\']{1}(.*?)["\']{1}\s*,\s*["\']{1}(.*?)["\']{1}#', $line, $matches)) 
    131131    { 
    132132      for ($j=0; $j<count($matches[1]); ++$j) 
     
    146146      } 
    147147       
    148       if (preg_match_all('#l10n_dec\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})(?:\s*),(?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $three_lines, $matches)) 
     148      if (preg_match_all('#l10n_dec\\(\s*["\']{1}(.*?)["\']{1}\s*,\s*["\']{1}(.*?)["\']{1}#', $three_lines, $matches)) 
    149149      { 
    150150        for ($j=0; $j<count($matches[1]); ++$j) 
     
    156156    } 
    157157    // l10n_args 
    158     if (preg_match_all('#get_l10n_args\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
     158    if (preg_match_all('#get_l10n_args\\(\s*["\']{1}(.*?)["\']{1}\s*[,)]{1}#', $line, $matches)) 
    159159    { 
    160160      for ($j=0; $j<count($matches[1]); ++$j) 
  • extensions/plugin_lang_analysis/main.inc.php

    r23488 r28862  
    1818global $conf; 
    1919 
    20 defined('PLA_ID') or define('PLA_ID', basename(dirname(__FILE__))); 
     20define('PLA_ID',    basename(dirname(__FILE__))); 
    2121define('PLA_PATH' , PHPWG_PLUGINS_PATH . PLA_ID . '/'); 
    2222define('PLA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PLA_ID); 
     
    3131} 
    3232 
    33 function pla_add_menu_item($content, &$smarty) 
     33function pla_add_menu_item($content) 
    3434{ 
    35   $search = 'href="{$U_UPDATES}">{\'Updates\'|@translate}</a></li>'; 
     35  $search = '{\'Updates\'|@translate}</a></li>'; 
    3636  $add = '<li><a class="icon-language" href="'.PLA_ADMIN.'">Plugin Language Analysis</a></li>'; 
    3737  return str_replace($search, $search."\n".$add, $content); 
    3838} 
    39  
    40 ?> 
Note: See TracChangeset for help on using the changeset viewer.