Changeset 884


Ignore:
Timestamp:
Apr 8, 2020, 7:27:09 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Error during user registration.
  • Fixed: Error on user enter to new team.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Core.php

    r883 r884  
    150150  function Link($Target)
    151151  {
    152     $Remaining = substr($Target, strlen($this->BaseURL));
     152    if (substr($Target, 0, strlen($this->BaseURL)) == $this->BaseURL)
     153      $Remaining = substr($Target, strlen($this->BaseURL));
     154      else $Remaining = $Target;
    153155    $TargetParts = explode('/', $Remaining);
    154     if ((count($TargetParts) > 0) and ($TargetParts[0] == '')) 
     156    if ((count($TargetParts) > 0) and ($TargetParts[0] == ''))
    155157      array_splice($TargetParts, 0, 1);
    156158    if (count($TargetParts) > 0)
  • trunk/Application/Version.php

    r883 r884  
    77
    88$Version = '1.0';
    9 $Revision = 883; // Subversion revision
     9$Revision = 884; // Subversion revision
    1010$DatabaseRevision = 873; // Database structure revision
    1111$ReleaseDate = strtotime('2020-04-08');
  • trunk/Application/View.php

    r881 r884  
    4040    foreach ($this->System->Bars['Top'] as $BarItem)
    4141      $Bar .= call_user_func($BarItem);
    42       if (trim($Bar) != '') $Output .= $Bar;
     42    if (trim($Bar) != '') $Output .= $Bar;
    4343      else $Output .= ' ';
    4444
     
    5454      '<div class="verticalmenu"><ul>';
    5555    foreach ($this->System->Menu as $MenuItem)
     56    {
    5657      if (!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission']))
    5758      {
     
    6364          $MenuItem['Link'].'"'.$OnClick.'>'.$MenuItem['Title'].'</a></li>';
    6465      }
    65       $Output .= '</ul></div>';
    66       return $Output;
     66    }
     67    $Output .= '</ul></div>';
     68    return $Output;
    6769  }
    6870
     
    101103    foreach ($this->System->Bars['Left'] as $BarItem)
    102104      $Bar .= call_user_func($BarItem);
    103       if (trim($Bar) != '') $Output .= $Bar;
     105    if (trim($Bar) != '') $Output .= $Bar;
    104106      else $Output .= '&nbsp;';
    105107
  • trunk/Modules/Admin/Admin.php

    r880 r884  
    127127      //  '(Select `ID` FROM `'.$Group['TablePrefix'].'` as `sub2` WHERE `sub2`.`Language` = 0 AND `T`.`Entry` = `sub2`.`Entry` AND `T`.`VersionStart` = `sub2`.`VersionStart`)'.
    128128      ' ';  //LIMIT 1000
    129       //echo $sql;
    130129      $DbResult = $this->System->Database->query($sql);
    131130      echo ': <br />'.$Group['TablePrefix'].': <br />';
     
    161160      ' WHERE `T`.`Language` = 0 '.
    162161      ' ORDER BY `T`.`VersionStart`';  //LIMIT 1000
    163       //echo $sql;
    164162      $DbResult = $this->System->Database->query($sql);
    165163      echo ': <br />'.$Group['TablePrefix'].': ';
     
    169167            ' WHERE  `T`.`Language` = 0 AND `T`.`VersionStart` > '.$line['VersionEnd'].' AND `T`.`Entry` = '.$line['Entry'].
    170168            ' ORDER BY `T`.`VersionStart` LIMIT 1';  //LIMIT 1000
    171         //   echo $sql;
    172169        $DbResult2 = $this->System->Database->query($sql);
    173         if ($DbResult2->num_rows > 0) {
     170        if ($DbResult2->num_rows > 0)
     171        {
    174172          $line2 = $DbResult2->fetch_assoc();
    175173
    176174          $Same = true;
    177           foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
     175          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     176          {
    178177            if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']]))
    179178              $Same = false;
    180179          }
    181           if ($Same) {
     180          if ($Same)
     181          {
    182182            echo $line['ID'].'='.$line2['ID'].' (';
    183183            //       $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE ID='.$line2['ID']);
     
    186186                ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') ';
    187187            $DbResult3 = $this->System->Database->query($sql);
    188             while ($line3 = $DbResult3->fetch_assoc()) {
     188            while ($line3 = $DbResult3->fetch_assoc())
     189            {
    189190              echo $line3['ID'].' ';
    190191              $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].', `VersionStart` = '.$line['VersionStart'].', `Take` = '.$line['ID'].' WHERE ID='.$line3['ID']);
     
    207208
    208209    $Output = '';
    209     if (array_key_exists('GameVersion', $_GET)) {
     210    if (array_key_exists('GameVersion', $_GET))
     211    {
    210212      $_SESSION['GameVersion'] = $_GET['GameVersion'];
    211213    }
     
    221223        $Output .= 'vloženo <br />';
    222224      }
    223       if (array_key_exists('id', $_GET)) {
     225      if (array_key_exists('id', $_GET))
     226      {
    224227        $Group = $TranslationTree[$_GET['id']];
    225228        //  $Output .= '<form action="?action=dbcstructure&amp;id='.$Group['Id'].'">';
     
    242245        $Line = $File->ReadLine();
    243246
    244         for ($i = 0; $i < substr_count($Line, ','); $i++) {
     247        for ($i = 0; $i < substr_count($Line, ','); $i++)
     248        {
    245249          $Output .= $i;
    246250          $Output .= '</td><td>';
    247251        }
    248252        $Output .= '</td></tr><tr><td>';
    249         for ($i = 0; $i < substr_count($Line, ','); $i++) {
     253        for ($i = 0; $i < substr_count($Line, ','); $i++)
     254        {
    250255          foreach ($Group['Items'] as $GroupItem)
    251256            $Output .=   ' <a href="'.$this->System->Link('/admin/?action=dbcstructure&amp;id='.
     
    259264        $Output .= str_replace(',', '</td><td>', $Line);
    260265        $Output .= '</td></tr><tr><td>';
    261         for ($i = 0; $i < 50; $i++) {
     266        for ($i = 0; $i < 50; $i++)
     267        {
    262268          $Line = $File->ReadLine();
    263269          $Output .= str_replace(',', '</td><td>', $Line);
     
    267273        $Output .= '</td></tr>';
    268274        $Output .= '</table>';
    269       } else {
     275      } else
     276      {
    270277        $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion`');
    271278        while ($Version = $DbResult->fetch_assoc())
  • trunk/Modules/Export/ProcessTask.php

    r880 r884  
    167167    echo('Packing files...'."\n");
    168168    $this->SetProgress(70);
    169     $workdir = str_replace('/',DIRECTORY_SEPARATOR, $Export->TempDir);
     169    $workdir = str_replace('/', DIRECTORY_SEPARATOR, $Export->TempDir);
    170170    $this->MPQPack($workdir.'lua');
    171171    $this->SetProgress(80);
  • trunk/Modules/Log/Log.php

    r881 r884  
    125125    $this->Title = T('System log');
    126126    $Output = '';
    127     if (array_key_exists('type', $_GET) and (is_numeric($_GET['type']))) $_SESSION['type'] = $_GET['type'] * 1;
    128     else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
     127    if (array_key_exists('type', $_GET))
     128    {
     129      if (is_numeric($_GET['type'])) $_SESSION['type'] = $_GET['type'] * 1;
     130        else $_SESSION['type'] = '';
     131    } else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
    129132
    130133    if (array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group'];
  • trunk/Modules/User/Options.php

    r880 r884  
    5353        '</form>';
    5454
    55     $Output .= '  <fieldset><legend>'.T('Translation team').'</legend>';
     55    $Output .= '<fieldset><legend>'.T('Translation team').'</legend>';
    5656    $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `Team`');
    57     $Output .= '<a href="team/?action=create">'.T('Create team').'</a><br />'.
    58         '<a href="team/?action=leave">'.T('Leave team').'</a><br />'.
    59         '<br /><form action="team/" method="get">'.
     57    $Output .= '<a href="'.$this->System->Link('/team/?action=create').'">'.T('Create team').'</a><br />'.
     58        '<a href="'.$this->System->Link('/team/?action=leave').'">'.T('Leave team').'</a><br />'.
     59        '<br /><form action="'.$this->System->Link('/team/').'" method="get">'.
    6060        '<input type="hidden" name="action" value="gointeam"/>'.
    6161        '<select name="id">';
     
    6666      $Output .= '>'.htmlspecialchars($LineTeam['Name']).'</option>';
    6767    }
    68     $Output .= '</select> <input type="submit" value="'.T('Enter').'" />
    69     </form>';
    70     $Output .= '</fieldset>';
     68    $Output .= '</select>'.
     69      '<input type="submit" value="'.T('Enter').'" />'.
     70      '</form>';
     71      '</fieldset>';
    7172    return $Output;
    7273  }
  • trunk/Modules/User/Registration.php

    r880 r884  
    103103      if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
    104104        else $Language = '';
    105       if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
     105      if (array_key_exists('ClientVersion', $_POST) and is_numeric($_POST['ClientVersion']))
     106        $PreferredVersion = $_POST['ClientVersion'] * 1;
    106107        else $PreferredVersion = '';
    107108      if ($PreferredVersion == '') $PreferredVersion = 'NULL';
  • trunk/Modules/User/User.php

    r880 r884  
    257257      // Refresh time of last access
    258258      $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()'));
    259     } else {
     259    } else
     260    {
    260261      if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
    261262        else $HostName = '';
     
    313314    $UserId = $this->Database->insert_id;
    314315    $this->Database->query('INSERT INTO `UserTrace` (`User`, `LastIP`, `UserAgent`) '.
    315         'VALUES ('.$UserId.', "'.GetRemoteAddress().'", '.
    316         '"'.$this->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'")');
     316      'VALUES ('.$UserId.', "'.GetRemoteAddress().'", '.
     317      '"'.$this->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'")');
    317318  }
    318319}
  • trunk/Packages/Common/Locale.php

    r880 r884  
    153153      foreach ($this->Texts->Data as $Index => $Item)
    154154      {
     155        if (is_array($Item)) continue;
    155156        $DbResult = $Database->select('Locale', '*', '(`Original` ='.$Database->quote($Index).
    156157          ') AND (`Language`='.($Language['Id']).')');
    157158        if ($DbResult->num_rows > 0)
    158         $Database->update('Locale', '(`Language`='.($Language['Id']).') AND '.
    159           '(`Original` ='.$Database->quote($Index).')', array('Translated' => $Item));
    160         else $Database->insert('Locale', array('Language' => $Language['Id'],
    161          'Original' => $Index, 'Translated' => $Item));
     159        {
     160          $Database->update('Locale', '(`Language`='.($Language['Id']).') AND '.
     161            '(`Original` ='.$Database->quote($Index).')', array('Translated' => $Item));
     162        } else
     163        {
     164          $Database->insert('Locale', array('Language' => $Language['Id'],
     165           'Original' => $Index, 'Translated' => $Item, 'Fuzzy' => 0));
     166        }
    162167      }
    163168    }
Note: See TracChangeset for help on using the changeset viewer.