Changeset 963


Ignore:
Timestamp:
Feb 3, 2024, 11:21:34 PM (3 months ago)
Author:
chronos
Message:
  • Fixed: RSS channel generation error.
  • Fixed: Show error message instead of generation of empty RSS channel.
  • Fixed: Wait minimum time if user not logged correctly.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r960 r963  
    11<?php
    22
    3 $Revision = 960; // Subversion revision
     3$Revision = 963; // Subversion revision
    44$DatabaseRevision = 957; // SQL structure revision
    5 $ReleaseTime = strtotime('2023-12-29');
     5$ReleaseTime = strtotime('2024-02-03');
  • trunk/Modules/News/NewsPage.php

    r958 r963  
    361361        if (substr($Index, 0, 8) == 'category') $Select .= '-'.substr($Index, 8);
    362362      }
    363       $Select = Core::Cast($this->System)->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1);
    364       $Output = 'Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>';
     363      if ($Select != '')
     364      {
     365        $Select = Core::Cast($this->System)->Config['Web']['RootFolder'].'/aktuality/rss/?select='.substr($Select, 1);
     366        $Output = 'Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>';
     367      } else
     368      {
     369        $Output = 'Nevybrána žádná kategorie pro vytvoření RSS kanálu.';
     370      }
    365371    } else
    366372    {
     
    409415    {
    410416      $Where = '';
    411       $Parts = explode('-', $_GET['select']);
    412       foreach ($Parts as $Part)
    413       {
    414         if (is_numeric($Part)) $Where .= 'OR (`Category`='.($Part * 1).')';
    415       }
    416       $Where = substr($Where, 2);
     417      $Parts = array_filter(explode('-', $_GET['select']));
     418      if (count($Parts) > 0)
     419      {
     420        foreach ($Parts as $Part)
     421        {
     422          if (is_numeric($Part)) $Where .= 'OR (`Category`='.($Part * 1).')';
     423        }
     424        if (strlen($Where) > 2) $Where = substr($Where, 2);
     425          else $Where = 1;
     426      } else $Where = 1;     
    417427    } else $Where = 1;
    418428
  • trunk/Modules/User/UserModel.php

    r954 r963  
    245245          setcookie('LoginUserId', $Row['Id'], time()+365*24*60*60, $this->System->Link('/'));
    246246          setcookie('LoginHash', sha1($Row['Id'].$StayLoggedSalt), time()+365*24*60*60, $this->System->Link('/'));
    247         } else {
     247        } else
     248        {
    248249          setcookie('LoginUserId', '', time() - 3600, $this->System->Link('/'));
    249250          setcookie('LoginHash', '', time() - 3600, $this->System->Link('/'));
     
    255256      }
    256257    } else $Result = USER_NOT_REGISTRED;
     258   
     259    // Wait some minimal time if not able to log in to avoid brute forcing passwords
     260    if ($Result != USER_LOGGED_IN) sleep(1);
     261
    257262    return $Result;
    258263  }
Note: See TracChangeset for help on using the changeset viewer.