- $listing_rows = db_get_assocs('files', 'id,filename,description', 'order by description limit 100');
+ $listing_rows = db_get_assocs('files', 'id,filename,description', 'order by coalesce(nullif(description, ""), substring(filename, 7)) limit 100');