Ignore:
Timestamp:
Nov 22, 2013, 11:34:47 AM (11 years ago)
Author:
maron
Message:
  • Fixed: url in Dictionary.php to Form.php name starts with $b$b,< etc. now find too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r594 r596  
    512512  'areatrigger_tavern' => 'Name',); */
    513513    $buff = array();
    514  
     514
     515    //change chars by we want to separate
     516    $Text = str_replace('$B$B',' ',$Text);
     517    $Text = str_replace('$b$b',' ',$Text);
     518    $Text = str_replace('$G',' ',$Text);
     519    $Text = str_replace('$I',' ',$Text);
     520    $Text = str_replace('$N',' ',$Text);
     521    $Text = str_replace('$R',' ',$Text);
     522    $Text = str_replace('$g',' ',$Text);
     523    $Text = str_replace('$i',' ',$Text);
     524    $Text = str_replace('$n',' ',$Text);
     525    $Text = str_replace('$r',' ',$Text);
     526    $Text = str_replace(':',' ',$Text);
     527    $Text = str_replace(';',' ',$Text);
     528    $Text = str_replace('!',' ',$Text);
     529    $Text = str_replace('?',' ',$Text);
     530    $Text = str_replace('.',' ',$Text);
     531    $Text = str_replace(',',' ',$Text);
     532    $Text = str_replace('\'s',' ',$Text);
     533    $Text = str_replace('<',' ',$Text);
     534    $Text = str_replace('>',' ',$Text);
     535    $ArrStr = explode(' ', $Text);
     536     
    515537  foreach($TablesColumn as $Table => $Column)
    516538  { 
     
    519541    $groupby = ' GROUP BY `'.$Column.'`';
    520542 
    521     $ArrStr = explode(' ', $Text);
     543
    522544    $where = '(`Language` = '.$Config['OriginalLanguage'].') ';
    523545    if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
     
    529551      for($i = 0; $i < count($ArrStr); $i++)
    530552      {
    531         if (strpos($ArrStr[$i],"'s") > 0)
    532        $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2);
    533         if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    534         if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    535         if (strpos($ArrStr[$i],'!') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    536         if (strpos($ArrStr[$i],'?') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     553       // if (strpos($ArrStr[$i],"'s") > 0)     $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2);
     554      //  if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     555       // if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     556       // if (strpos($ArrStr[$i],'!') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
     557       // if (strpos($ArrStr[$i],'?') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1);
    537558
    538559        if (strlen($ArrStr[$i]) > 4) {
    539560          $where .= '(`O`.`'.$Column.'` LIKE "%'.addslashes($ArrStr[$i]).'%") OR ';
    540561          $SqlOK = true;
    541       }
     562        }
    542563      }
    543564      $where = substr($where, 0, strlen($where) - 4);
     
    550571          $buff[] = array($Line['ID'], GetIDbyName($Table), $Line[$Column], $Line['Tran']);
    551572        }
    552     }
     573      }
    553574    }
    554575  }
Note: See TracChangeset for help on using the changeset viewer.