Skip to content

Commit

Permalink
PHP 8.2: Don't str_replace( null ) #220
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Sep 15, 2023
1 parent 148de68 commit a149e0f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shortcodes/oik-googlemap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
Copyright 2011-2018 Bobbing Wide (email : [email protected] )
Copyright 2011-2018, 2023 Bobbing Wide (email : [email protected] )
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -225,7 +225,7 @@ function bw_show_googlemap( $atts=null, $content=null, $tag=null ) {
$width = bw_array_get( $atts, "width", null );
$height = bw_array_get( $atts, "height", null );
$zoom = bw_array_get( $atts, "zoom", 12 );
$alt = bw_array_get( $atts, "alt", null );
$alt = bw_array_get( $atts, "alt", '' );
$alt = str_replace( "0", "", $alt );
$gmap_intro = bw_get_option_arr( "gmap_intro", "bw_options", $atts );
if ( $gmap_intro ) {
Expand All @@ -247,8 +247,9 @@ function bw_show_googlemap( $atts=null, $content=null, $tag=null ) {
if ( !$postcode ) {
$postcode = bw_get_option_arr( "postal-code", "bw_options", $atts );
}
$postcode = str_replace( " ", "&nbsp;", $postcode );

if ( null !== $postcode ) {
$postcode=str_replace( " ", "&nbsp;", $postcode );
}

bw_googlemap_v3( $company
, $lat
Expand Down

0 comments on commit a149e0f

Please sign in to comment.