# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- components/com_comprofiler/comprofiler.php +++ components/com_comprofiler/comprofiler.php @@ -885,6 +885,16 @@ // build SQL Select query: if( $row->sortfields != '' ) { + if ( preg_match( '!^(?:(RAND\(\))\s(ASC|DESC))$!', $row->sortfields, $matches ) ) { + $random = (int) cbGetParam( $_GET, 'rand', 0 ); + + if ( ! $random ) { + $random = rand( 0, 9999 ); + } + + $row->sortfields = 'RAND(' . $random . ') ' . $matches[2]; + } + $orderby = "\n ORDER BY " . $row->sortfields; } $filterby = '';