Skip to content

Commit

Permalink
esc_sql for $order attribute
Browse files Browse the repository at this point in the history
* Security improvement for $order
  • Loading branch information
andrewlimaza committed Feb 19, 2024
1 parent 162ef7a commit 7885e15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function pmpromd_shortcode($atts, $content=null, $code="")

// Clean up order_by to only include text, underscores and periods.
$order_by = preg_replace( '/[^a-z._]/', '', $order_by );
$sql_parts['ORDER'] = "ORDER BY ". esc_sql($order_by) . " " . $order . " ";
$sql_parts['ORDER'] = "ORDER BY ". esc_sql( $order_by ) . " " . esc_sql( $order ) . " ";

$sql_parts['LIMIT'] = "LIMIT $start, $limit";

Expand Down

0 comments on commit 7885e15

Please sign in to comment.