Compare sort order direction in uppercase

Querying with 'order' => 'desc' rather than 'order' => 'DESC'
was causing issues, strtoupper so always compare with the same
case.

Change-Id: Idca679da5a53e2d58408a2871d14177c6b135e56
Merge "Compare sort order direction in uppercase"