Increased the sorting to 5 chars. Should be enough, fixes #756

This commit is contained in:
Andreas Burchert (scarya)
2011-06-23 23:44:11 +02:00
parent 5184dc9ce7
commit 6badc2ad77

View File

@@ -201,7 +201,7 @@ class paging
$this->userinfo['lastpaging']['searchfield'] = $this->searchfield; $this->userinfo['lastpaging']['searchfield'] = $this->searchfield;
if(isset($_REQUEST['searchtext']) if(isset($_REQUEST['searchtext'])
&& (preg_match("/^[@0-9a-zA-Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\-\*\.]+$/", $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === '')) && (preg_match("/^[@0-9a-zA-Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\-\*\.]+$/", $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === ''))
{ {
$this->searchtext = $_REQUEST['searchtext']; $this->searchtext = $_REQUEST['searchtext'];
} }
@@ -209,7 +209,7 @@ class paging
{ {
if($checklastpaging if($checklastpaging
&& isset($this->userinfo['lastpaging']['searchtext']) && isset($this->userinfo['lastpaging']['searchtext'])
&& preg_match("/^[@0-9a-zA-Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\-\*\.]+$/", $this->userinfo['lastpaging']['searchtext'])) && preg_match("/^[@0-9a-zA-Z<><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\-\*\.]+$/", $this->userinfo['lastpaging']['searchtext']))
{ {
$this->searchtext = $this->userinfo['lastpaging']['searchtext']; $this->searchtext = $this->userinfo['lastpaging']['searchtext'];
} }
@@ -358,7 +358,7 @@ class paging
{ {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556 // Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$sortcode = 'ORDER BY CONCAT( IF( ASCII( LEFT( ' . $sortfield . ', 1 ) ) > 57, LEFT( ' . $sortfield . ', 1 ), \'0\' ), IF( ASCII( RIGHT( ' . $sortfield . ', 1 ) ) > 57, LPAD( ' . $sortfield . ', 255, \'0\' ), LPAD( CONCAT( ' . $sortfield . ', \'-\' ), 255, \'0\' ) ) ) ' . $sortorder; $sortcode = 'ORDER BY CONCAT( IF( ASCII( LEFT( ' . $sortfield . ', 5 ) ) > 57, LEFT( ' . $sortfield . ', 1 ), \'0\' ), IF( ASCII( RIGHT( ' . $sortfield . ', 1 ) ) > 57, LPAD( ' . $sortfield . ', 255, \'0\' ), LPAD( CONCAT( ' . $sortfield . ', \'-\' ), 255, \'0\' ) ) ) ' . $sortorder;
} }
else else
{ {