Skip to content

Commit 182c311

Browse files
committed
Do not pass null to strototime or preg_match
1 parent 9fad9de commit 182c311

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/WP_Export_Query.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private function author_where() {
245245

246246
private function start_date_where() {
247247
global $wpdb;
248-
$timestamp = strtotime( $this->filters['start_date'] );
248+
$timestamp = $this->filters['start_date'] ? strtotime( $this->filters['start_date'] ) : null;
249249
if ( ! $timestamp ) {
250250
return;
251251
}
@@ -254,6 +254,9 @@ private function start_date_where() {
254254

255255
private function end_date_where() {
256256
global $wpdb;
257+
if ( ! $this->filters['end_date'] ) {
258+
return;
259+
}
257260
if ( preg_match( '/^\d{4}-\d{2}$/', $this->filters['end_date'] ) ) {
258261
$timestamp = $this->get_timestamp_for_the_last_day_of_a_month( $this->filters['end_date'] );
259262
} else {

0 commit comments

Comments
 (0)