@@ -536,7 +536,7 @@ public function get_upload_details() {
536536 $ upload_path = trim ( get_option ( 'upload_path ' ) );
537537 $ dir = $ upload_path ;
538538
539- if ( empty ( $ upload_path ) || 'wp-content/uploads ' == $ upload_path ) {
539+ if ( empty ( $ upload_path ) || 'wp-content/uploads ' === $ upload_path ) {
540540 $ dir = WP_CONTENT_DIR . '/uploads ' ;
541541 } elseif ( 0 !== strpos ( $ upload_path , ABSPATH ) ) {
542542 /* $dir is absolute, $upload_path is (maybe) relative to ABSPATH */
@@ -545,7 +545,7 @@ public function get_upload_details() {
545545
546546 $ url = get_option ( 'upload_url_path ' );
547547 if ( ! $ url ) {
548- if ( empty ( $ upload_path ) || ( 'wp-content/uploads ' == $ upload_path ) || ( $ upload_path == $ dir ) ) {
548+ if ( empty ( $ upload_path ) || ( 'wp-content/uploads ' === $ upload_path ) || ( $ upload_path = == $ dir ) ) {
549549 $ url = WP_CONTENT_URL . '/uploads ' ;
550550 } else {
551551 $ url = trailingslashit ( $ siteurl ) . $ upload_path ;
@@ -575,7 +575,7 @@ public function get_upload_details() {
575575 public function convert_url_to_path ( $ url ) {
576576
577577 /* If $url is empty we'll return early */
578- if ( trim ( $ url ) == false ) {
578+ if ( empty ( trim ( $ url ) ) ) {
579579 return $ url ;
580580 }
581581
@@ -633,7 +633,7 @@ public function convert_url_to_path( $url ) {
633633 public function convert_path_to_url ( $ path ) {
634634
635635 /* If $url is empty we'll return early */
636- if ( trim ( $ path ) == false ) {
636+ if ( empty ( trim ( $ path ) ) ) {
637637 return $ path ;
638638 }
639639
@@ -709,7 +709,7 @@ public function strip_invalid_characters( $name ) {
709709 public function get_legacy_ids ( $ entry_id , $ settings ) {
710710
711711 $ leads = rgget ( 'lid ' );
712- $ override = ( isset ( $ settings ['public_access ' ] ) && $ settings ['public_access ' ] == 'Yes ' ) ? true : false ;
712+ $ override = ( isset ( $ settings ['public_access ' ] ) && $ settings ['public_access ' ] === 'Yes ' ) ? true : false ;
713713
714714 if ( $ leads && ( $ override === true || $ this ->gform ->has_capability ( 'gravityforms_view_entries ' ) ) ) {
715715 $ ids = explode ( ', ' , $ leads );
@@ -853,14 +853,14 @@ public function get_fields_sorted_by_id( $form_id ) {
853853 public function backwards_compat_conversion ( $ settings , $ form , $ entry ) {
854854
855855 $ compat = [];
856- $ compat ['premium ' ] = ( isset ( $ settings ['advanced_template ' ] ) && $ settings ['advanced_template ' ] == 'Yes ' ) ? true : false ;
857- $ compat ['rtl ' ] = ( isset ( $ settings ['rtl ' ] ) && $ settings ['rtl ' ] == 'Yes ' ) ? true : false ;
856+ $ compat ['premium ' ] = ( isset ( $ settings ['advanced_template ' ] ) && $ settings ['advanced_template ' ] === 'Yes ' ) ? true : false ;
857+ $ compat ['rtl ' ] = ( isset ( $ settings ['rtl ' ] ) && $ settings ['rtl ' ] === 'Yes ' ) ? true : false ;
858858 $ compat ['dpi ' ] = ( isset ( $ settings ['image_dpi ' ] ) ) ? (int ) $ settings ['image_dpi ' ] : 96 ;
859- $ compat ['security ' ] = ( isset ( $ settings ['security ' ] ) && $ settings ['security ' ] == 'Yes ' ) ? true : false ;
859+ $ compat ['security ' ] = ( isset ( $ settings ['security ' ] ) && $ settings ['security ' ] === 'Yes ' ) ? true : false ;
860860 $ compat ['pdf_password ' ] = ( isset ( $ settings ['password ' ] ) ) ? $ this ->gform ->process_tags ( $ settings ['password ' ], $ form , $ entry ) : '' ;
861861 $ compat ['pdf_privileges ' ] = ( isset ( $ settings ['privileges ' ] ) ) ? $ settings ['privileges ' ] : '' ;
862- $ compat ['pdfa1b ' ] = ( isset ( $ settings ['format ' ] ) && $ settings ['format ' ] == 'PDFA1B ' ) ? true : false ;
863- $ compat ['pdfx1a ' ] = ( isset ( $ settings ['format ' ] ) && $ settings ['format ' ] == 'PDFX1A ' ) ? true : false ;
862+ $ compat ['pdfa1b ' ] = ( isset ( $ settings ['format ' ] ) && $ settings ['format ' ] === 'PDFA1B ' ) ? true : false ;
863+ $ compat ['pdfx1a ' ] = ( isset ( $ settings ['format ' ] ) && $ settings ['format ' ] === 'PDFX1A ' ) ? true : false ;
864864
865865 return $ compat ;
866866 }
@@ -917,11 +917,13 @@ public function maybe_load_gf_entry_detail_class() {
917917 */
918918 public function in_array ( $ needle , $ haystack , $ strict = true ) {
919919 foreach ( $ haystack as $ item ) {
920+ /* phpcs:disable */
920921 if ( ( $ strict ? $ item === $ needle : $ item == $ needle ) ||
921922 ( is_array ( $ item ) && $ this ->in_array ( $ needle , $ item , $ strict ) )
922923 ) {
923924 return true ;
924925 }
926+ /* phpcs:enable */
925927 }
926928
927929 return false ;
0 commit comments