| @@ -161,9 +161,9 @@ | ||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // only select queries allowed. |
| 164 | 164 | if ( preg_match( '/^\s*(insert|delete|update|replace|create|alter|drop|truncate)\s/i', $this->_query ) ) { |
| 165 | - $this->_error = __( 'Only SELECT queries are allowed', CHART_BUILDER_NAME ); | |
| 165 | + $this->_error = __( 'Only SELECT queries are allowed', 'chart-builder' ); | |
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $validate_query = str_replace( "\n", ' ', $this->_query ); |
| @@ -282,9 +282,9 @@ | ||
| 282 | 282 | <thead> |
| 283 | 283 | <tr> |
| 284 | 284 | <?php |
| 285 | 285 | foreach ( $headers as $header ) { |
| 286 | - echo '<th>' . $header['label'] . '</th>'; | |
| 286 | + echo '<th>' . esc_html($header['label']) . '</th>'; | |
| 287 | 287 | } |
| 288 | 288 | ?> |
| 289 | 289 | </tr> |
| 290 | 290 | </thead> |
| @@ -294,9 +294,9 @@ | ||
| 294 | 294 | <?php |
| 295 | 295 | foreach ( $results as $result ) { |
| 296 | 296 | echo '<tr>'; |
| 297 | 297 | foreach ( $result as $r ) { |
| 298 | - echo '<td>' . $r . '</td>'; | |
| 298 | + echo '<td>' . esc_html($r) . '</td>'; | |
| 299 | 299 | } |
| 300 | 300 | echo '</tr>'; |
| 301 | 301 | } |
| 302 | 302 | ?> |
| @@ -532,9 +532,9 @@ | ||
| 532 | 532 | // let's randomly pick 5 data points instead of cycling through the entire data set. |
| 533 | 533 | if ( count( $data ) > 5 ) { |
| 534 | 534 | $random = array(); |
| 535 | 535 | for ( $x = 0; $x < 5; $x++ ) { |
| 536 | - $random[] = $data[ rand( 0, count( $data ) - 1 ) ]; | |
| 536 | + $random[] = $data[ wp_rand( 0, count( $data ) - 1 ) ]; | |
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | foreach ( $types as $type ) { |