Skip to content

Commit 1cdf96d

Browse files
committed
PLUGINS-6307 fixed warning message
1 parent 8bbad48 commit 1cdf96d

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/ecwid_catalog_entry.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,11 @@ public function get_seo_link( $baseUrl = '' ) {
9393
$url .= '/';
9494
}
9595

96-
preg_match( '!([^\/]+-[p|c][0-9]+)$!', $this->_data->url, $slug );
97-
98-
if( ! empty( $slug[1] ) ) {
99-
$url .= $slug[1];
100-
} else {
101-
$url .= $this->_linkify( $this->_data->name ) . '-' . $this->_link_prefix . $this->_data->id;
102-
}
96+
if ( ! empty( $this->_data->url ) && preg_match( '!([^\/]+-[p|c][0-9]+)$!', $this->_data->url, $slug)) {
97+
$url .= $slug[1];
98+
} else {
99+
$url .= $this->_linkify($this->_data->name) . '-' . $this->_link_prefix . $this->_data->id;
100+
}
103101

104102
if ( ! empty( $query ) ) {
105103
$url .= '/?' . $query;

0 commit comments

Comments
 (0)