- foreach ( explode(',', $orderby) as $ordparam )
- $orderparams[] = 'link_' . trim($ordparam);
+ foreach ( explode(',', $orderby) as $ordparam ) {
+ $ordparam = trim($ordparam);
+ $keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes' );
+ if ( in_array( 'link_' . $ordparam, $keys ) )
+ $orderparams[] = 'link_' . $ordparam;
+ elseif ( in_array( $ordparam, $keys ) )
+ $orderparams[] = $ordparam;
+ }