Changeset 23584


Ignore:
Timestamp:
Jun 27, 2013, 3:33:55 AM (11 years ago)
Author:
mistic100
Message:

detect translate with escaped quotes (in php strings)
detect translate_dec 2.6 function

Location:
extensions/plugin_lang_analysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/plugin_lang_analysis/admin.php

    r23488 r23584  
    230230   
    231231    $strings[ $string ] = $string_data;
     232    $counts['useless']++;
    232233  }
    233234 
  • extensions/plugin_lang_analysis/include/functions.inc.php

    r23467 r23584  
    111111    }
    112112    // translate
    113     if (preg_match_all('#\{(?:["\']{1})(.*?)(?:["\']{1})\|(?:@{0,1})translate#', $line, $matches))
     113    if (preg_match_all('#\{(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1})\|(?:@{0,1})translate#', $line, $matches))
    114114    {
    115115      for ($j=0; $j<count($matches[1]); ++$j)
    116116      {
    117117        $strings[ stripslashes($matches[1][$j]) ][] = $i+1;
     118      }
     119    }
     120    // translate_dec
     121    if (preg_match_all('#translate_dec:(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1}):(?:\\\\{0,1})(?:["\']{1})(.*?)(?:\\\\{0,1})(?:["\']{1})}#', $line, $matches))
     122    {
     123      for ($j=0; $j<count($matches[1]); ++$j)
     124      {
     125        $strings[ stripslashes($matches[1][$j]) ][] = $i+1;
     126        $strings[ stripslashes($matches[2][$j]) ][] = $i+1;
    118127      }
    119128    }
Note: See TracChangeset for help on using the changeset viewer.