Changeset 26998


Ignore:
Timestamp:
Jan 27, 2014, 6:33:28 PM (7 years ago)
Author:
mistic100
Message:

remove *_version_compare methods in languages & plugins & themes classes, unused and outdated (preg_replace /e modifier)

Location:
trunk/admin/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/languages.class.php

    r26461 r26998  
    403403   * Sort functions
    404404   */
    405   function language_version_compare($a, $b)
    406   {
    407     $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
    408     $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
    409 
    410     $array = preg_replace($pattern, $replacement, array($a, $b));
    411 
    412     return version_compare($array[0], $array[1], '>=');
    413   }
    414 
    415405  function extension_name_compare($a, $b)
    416406  {
  • trunk/admin/include/plugins.class.php

    r26909 r26998  
    616616   * Sort functions
    617617   */
    618   function plugin_version_compare($a, $b)
    619   {
    620     if (strtolower($a) == 'auto') return false;
    621    
    622     $array = preg_replace(
    623       array('/\.+/', '/\.\Z|\A\./'),
    624       array('.', ''),
    625       array($a, $b)
    626       );
    627      
    628     $array = preg_replace_callback(
    629       '/([a-z])/i',
    630       create_function('$m', 'return intval($m[1], 36);'),
    631       $array
    632       );
    633    
    634     return version_compare($array[0], $array[1], '>=');
    635   }
    636 
    637618  function extension_revision_compare($a, $b)
    638619  {
  • trunk/admin/include/themes.class.php

    r26461 r26998  
    690690   * Sort functions
    691691   */
    692   function theme_version_compare($a, $b)
    693   {
    694     $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
    695     $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
    696 
    697     $array = preg_replace($pattern, $replacement, array($a, $b));
    698 
    699     return version_compare($array[0], $array[1], '>=');
    700   }
    701 
    702692  function extension_revision_compare($a, $b)
    703693  {
Note: See TracChangeset for help on using the changeset viewer.