Skip to content

Commit 7503671

Browse files
impose a limit clause if not specified
1 parent 4b2fbf7 commit 7503671

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

classes/Visualizer/Source/Query.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public function fetch( $as_html = false ) {
6565
return false;
6666
}
6767

68+
// impose a limit if no limit clause is provided.
69+
if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) {
70+
$this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 300 );
71+
}
72+
6873
global $wpdb;
6974
$wpdb->hide_errors();
7075
// @codingStandardsIgnoreStart

0 commit comments

Comments
 (0)