From f8fe9e7fed6e53824ba300ffb394d235fb3cb09a Mon Sep 17 00:00:00 2001 From: John Saunders Date: Thu, 12 Aug 2021 10:59:41 +0100 Subject: [PATCH] pagination fix --- src/DB/ShardMatrixStatements.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DB/ShardMatrixStatements.php b/src/DB/ShardMatrixStatements.php index a28f5f5..733f133 100644 --- a/src/DB/ShardMatrixStatements.php +++ b/src/DB/ShardMatrixStatements.php @@ -136,6 +136,12 @@ private function orderResults( &$results, bool $row = false ) { } $aComp = substr( $aComp, 0, 72 ); $bComp = substr( $bComp, 0, 72 ); + if ( ! ctype_digit( $aComp ) ) { + $aComp = ltrim( $aComp, '0' ); + } + if ( ! ctype_digit( $bComp ) ) { + $bComp = ltrim( $bComp, '0' ); + } if ( $desc ) { return strcmp( strtolower( $bComp ), strtolower( $aComp ) ); }