Skip to content

Commit

Permalink
Fix PHP error when exceptions is not an array on admin
Browse files Browse the repository at this point in the history
  • Loading branch information
everaldomatias committed Apr 9, 2023
1 parent 3d417f5 commit 61d9aad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ With this, I keep the plugin here on Github and will continue to improve it acco

## Changelog ##

#### 3.3.1 - 2023-04-09 ####
- Fix PHP error when exceptions is not an array on admin

#### 3.3.0 - 2023-04-09 ####
- Fix button CSS
- Fix PHP error when numbers is empty on admin
Expand Down
18 changes: 9 additions & 9 deletions includes/class-open-whatsapp-chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ public function owc_print_button() {
$is_show = true;
$owc_exceptions = $owc_option['owc_exceptions'];

foreach ( $owc_exceptions as $owc_exception ) {

if (substr( $owc_exception, -1) === '/' ) {
$owc_exception = substr( $owc_exception, 0, -1 );
}

if ( trim( $owc_exception ) == $this->owc_get_url() ) {
$is_show = false;
if ( is_array( $owc_exceptions ) ) {
foreach ( $owc_exceptions as $owc_exception ) {
if ( substr( $owc_exception, -1) === '/' ) {
$owc_exception = substr( $owc_exception, 0, -1 );
}

if ( trim( $owc_exception ) == $this->owc_get_url() ) {
$is_show = false;
}
}

}

if ( $is_show && $owc_option['owc_number'] && $owc_option['owc_message'] ) {
Expand Down

0 comments on commit 61d9aad

Please sign in to comment.