Changeset 3052698
- Timestamp:
- 03/17/2024 02:33:03 PM (2 years ago)
- File:
-
- 1 edited
-
smart-app-banner/trunk/wsl-smart-app-banner.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smart-app-banner/trunk/wsl-smart-app-banner.php
r3052694 r3052698 66 66 } 67 67 68 if ( ( is_null( $app_id_list ) || '' == $app_id ) &&69 ( is_front_page() || get_option( 'wsl_global_banner' ) == 'Yes' ) ) {68 if ( ( is_null( $app_id_list ) || '' === $app_id ) && 69 ( is_front_page() || get_option( 'wsl_global_banner' ) === 'Yes' ) ) { 70 70 $app_id = get_option( 'wsl_homepage_appid' ); 71 71 $app_id_ipad = get_option( 'wsl_homepage_appid_ipad' ); … … 75 75 76 76 // if it's not there, exit. 77 if ( is_null( $app_id ) || '' == $app_id ) {77 if ( is_null( $app_id ) || '' === $app_id ) { 78 78 return; 79 79 } … … 81 81 $options = ''; 82 82 83 if ( ! is_null( $affiliate_data ) && '' != $affiliate_data ) {83 if ( ! is_null( $affiliate_data ) && '' !== $affiliate_data ) { 84 84 $options = "$options, affiliate-data=$affiliate_data"; 85 85 } 86 if ( ! is_null( $app_argument ) && '' != $app_argument ) {86 if ( ! is_null( $app_argument ) && '' !== $app_argument ) { 87 87 $options = "$options, app-argument=$app_argument"; 88 88 } 89 89 90 90 // if it is, output the header. 91 if ( is_null( $app_id_ipad ) || '' == $app_id_ipad ) {91 if ( is_null( $app_id_ipad ) || '' === $app_id_ipad ) { 92 92 echo "<meta name=\"apple-itunes-app\" content=\"app-id=$app_id$options\"/>"; 93 93 } else { … … 95 95 <script language="javascript"> 96 96 <!-- 97 if (navigator.userAgent.match(/iPad/i) != null) {97 if (navigator.userAgent.match(/iPad/i) !== null) { 98 98 document.write("<meta name=\"apple-itunes-app\" content=\"app-id=<?php echo "$app_id_ipad$options"; ?>\"/>\n"); 99 99 } … … 141 141 $protocol = wp_parse_url( $url, PHP_URL_SCHEME ); 142 142 $disallowed_protocols = array( 'javascript' ); 143 if ( in_array( $protocol, $disallowed_protocols ) ) {143 if ( in_array( $protocol, $disallowed_protocols, true ) ) { 144 144 return false; 145 145 } … … 159 159 function wsl_validate_input( $app_id, $app_id_ipad, $affiliate_data, $app_argument ) { 160 160 $error_message = null; 161 if ( preg_match( '/[^0-9]/', $app_id ) == 1 ) {161 if ( preg_match( '/[^0-9]/', $app_id ) === 1 ) { 162 162 $error_message = __( 'Invalid App ID' ); 163 } elseif ( preg_match( '/[^0-9]/', $app_id_ipad ) == 1 ) {163 } elseif ( preg_match( '/[^0-9]/', $app_id_ipad ) === 1 ) { 164 164 $error_message = __( 'Invalid iPad App ID' ); 165 } elseif ( isset( $app_argument ) && '' != $app_argument && ! wsl_custom_url_validator( $app_argument ) ) {165 } elseif ( isset( $app_argument ) && '' !== $app_argument && ! wsl_custom_url_validator( $app_argument ) ) { 166 166 $error_message = __( 'Invalid URL for app argument' ); 167 167 } … … 205 205 // See if the user has posted us some information. 206 206 // If they did, this hidden field will be set to 'Y'. 207 if ( isset( $_POST[ $hidden_field_name ] ) && 'Y' == $_POST[ $hidden_field_name ] ) {207 if ( isset( $_POST[ $hidden_field_name ] ) && 'Y' === $_POST[ $hidden_field_name ] ) { 208 208 209 209 if ( ! isset( $_POST['wsl-update'] ) || ! wp_verify_nonce( $_POST['wsl-update'], 'wsl-update' ) ) { … … 225 225 <div class="error"><p><strong><?php _e( $error_message, 'smart-app-banner' ); ?></strong></p></div> 226 226 <?php 227 } elseif ( isset( $app_id ) && '' != $app_id ) {227 } elseif ( isset( $app_id ) && '' !== $app_id ) { 228 228 $app_list[ $app_id ] = array( 229 229 'app_name' => $app_name, … … 260 260 update_option( $affiliate_field_name, $affiliate_val ); 261 261 update_option( $argument_field_name, $argument_val ); 262 if ( 'Yes' == $_POST[ $global_banner_field_name ] ) {262 if ( 'Yes' === $_POST[ $global_banner_field_name ] ) { 263 263 update_option( $global_banner_field_name, 'Yes' ); 264 264 } else { … … 330 330 <td><input type="checkbox" name="<?php echo $global_banner_field_name; ?>" value="Yes" 331 331 <?php 332 if ( 'Yes' == $global_banner_val ) {332 if ( 'Yes' === $global_banner_val ) { 333 333 echo 'checked'; } 334 334 ?>
Note: See TracChangeset
for help on using the changeset viewer.