bhengh

SB fix to strengthen against bad URL requests

Aug 23rd, 2013
53
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ( strtolower($order['dir']) != 'desc' and strtolower($order['dir']) != 'asc' )
  2. $order['dir'] = $default_order['dir'];
  3. $valid_sortby_values = array( 'm.id', 'm.title', 'm.datetime', 'm.start', 'm.end', 'p.id', 'p.name', 's.id', 's.name', 'ss.id', 'ss.name');
  4. if ( !in_array($order['by'], $valid_sortby_values) )
  5. $order['by'] = $default_order['by'];
RAW Paste Data