Skip to content
  • Michael Hawkins's avatar
    MDL-72096 core: Add safe ORDER BY helpers for db sorting from user input · 6d26ba77
    Michael Hawkins authored
    The new get_safe_orderby() and get_safe_orderby_multiple() methods
    provide a centralised safe way for user submitted sorting values to be
    incorporated into SQL ORDER BY. They do this by removing the need for
    user submitted data to pass in any SQL and not allowing arbitrary
    column values, instead using string keys which map to a predefined
    list of allowed sortable columns.
    6d26ba77