Plugin Directory

Changeset 3437833


Ignore:
Timestamp:
01/12/2026 02:57:38 PM (6 weeks ago)
Author:
pietror91
Message:

Fix Php 7.*

Location:
rapisafe-multi-file-cf7/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • rapisafe-multi-file-cf7/trunk/rapisafe-multi-file-cf7.php

    r3437611 r3437833  
    55 * Description: Secure multiple file upload field for Contact Form 7.
    66 * Text Domain: rapisafe-multi-file-cf7
    7  * Version: 1.0.3
     7 * Version: 1.0.4
    88 * Requires at least: 5.4
    99 * Domain Path: /languages
  • rapisafe-multi-file-cf7/trunk/readme.txt

    r3437611 r3437833  
    66Requires at least: 5.4
    77Tested up to: 6.9
    8 Stable tag: 1.0.3
     8Stable tag: 1.0.4
    99Requires PHP: 7.2
    1010License: GPLv2 or later
     
    152152== Changelog ==
    153153
     154= 1.0.4 =
     155PHP 7.* fix
     156
    154157= 1.0.3 =
    155158Fix warning
     
    172175== Upgrade Notice ==
    173176
     177= 1.0.4 =
     178PHP 7.* fix
     179
    174180= 1.0.3 =
    175181Fix warning
  • rapisafe-multi-file-cf7/trunk/src/RSMFCF7_Assets.php

    r3437456 r3437833  
    128128    }
    129129
    130     public static function extractFirstPage( $targetFullPath ) : false|string {
     130    /**
     131     * @param $targetFullPath
     132     * @return false|string
     133     */
     134    public static function extractFirstPage( $targetFullPath ) {
    131135        if ( !extension_loaded( 'imagick' ) ) {
    132136            return false;
  • rapisafe-multi-file-cf7/trunk/src/RSMFCF7_EnvChecker.php

    r3437456 r3437833  
    44class RSMFCF7_EnvChecker {
    55
    6     private int $counter = 1;
     6    private $counter = 1;
    77
    8     private array $successResult = [];
     8    private $successResult = [];
    99
    10     private array $errorsResult = [];
     10    private $errorsResult = [];
    1111
    1212    public function __construct() {
  • rapisafe-multi-file-cf7/trunk/src/RSMFCF7_FileZipper.php

    r3437456 r3437833  
    44
    55class RSMFCF7_FileZipper {
    6     public static function createZip( array $files, string $name, $password = "" ) : array|false {
     6    /**
     7     * @param array $files
     8     * @param string $name
     9     * @param $password
     10     * @return array|false
     11     */
     12    public static function createZip( array $files, string $name, $password = "" ) {
    713        if ( empty( $files ) ) {
    814            return false;
  • rapisafe-multi-file-cf7/trunk/src/RSMFCF7_Helpers.php

    r3437497 r3437833  
    6060        $size = trim( strtolower( $size ) );
    6161        if ( preg_match( '/^([0-9]+(?:\\.[0-9]+)?)(kb|mb|b)?$/', $size, $m ) ) {
    62             $num = floatval( $m[1] );
    63             $unit = $m[2] ?? 'b';
    64             return match ($unit) {
    65                 'kb' => $num * 1024,
    66                 'mb' => $num * 1024 * 1024,
    67                 default => $num,
    68             };
     62            $num = (float) $m[1];
     63            $unit = ( isset( $m[2] ) ? $m[2] : 'b' );
     64            switch ( $unit ) {
     65                case 'kb':
     66                    return (int) ($num * 1024);
     67                case 'mb':
     68                    return (int) ($num * 1024 * 1024);
     69                default:
     70                    return (int) $num;
     71            }
    6972        }
    7073        return 0;
  • rapisafe-multi-file-cf7/trunk/src/settings/RSMFCF7_MultiFileTabSettings.php

    r3437611 r3437833  
    5555
    5656    /**
    57      * @param int $post_id
     57     * @param int|null $post_id
    5858     * @return array
    5959     */
    60     public static function get_settings( int|null $post_id ) : array {
     60    public static function get_settings( $post_id ) : array {
    6161        $cf7_data = get_post_meta( $post_id, "multi-file-upload-contact-form-7", true );
    6262        return ( is_array( $cf7_data ) && !empty( $cf7_data ) ? $cf7_data : [
     
    110110        $borderColor = ( !empty( $settings['border-color'] ) ? RSMFCF7_Helpers::sanitizeHexColorValue( $settings['border-color'] ) : '#000000' );
    111111        $bgColor = ( !empty( $settings['bg-color'] ) ? RSMFCF7_Helpers::sanitizeHexColorValue( $settings['bg-color'] ) : '#FFFFFF' );
    112         $dragAndDropEnable = isset($settings['enable-drag-and-drop']) ?? false;
     112        $dragAndDropEnable = isset( $settings['enable-drag-and-drop'] ) ?? false;
    113113        $maxAjaxSyncFiles = ( (int) $settings['max-ajax-sync-files'] ? $settings['max-ajax-sync-files'] : 1 );
    114         $hideSvgIcon = isset($settings['hide-svg-icon']) ?? false;
     114        $hideSvgIcon = isset( $settings['hide-svg-icon'] ) ?? false;
    115115        $svgIconColor = RSMFCF7_Helpers::sanitizeHexColorValue( $settings['svg-icon-color'] );
    116         $hideSuggestion = isset($settings['hide-suggestion']);
     116        $hideSuggestion = isset( $settings['hide-suggestion'] );
    117117        $boxPreviewColumns = $settings['box-preview-columns'] ?? 3;
    118118        $borderRadius = (int) $settings['border-radius'];
    119         $previewEnable = isset($settings['enable-link-preview'])??false;
     119        $previewEnable = isset( $settings['enable-link-preview'] ) ?? false;
    120120        $cf7_data = [
    121121            'style'                => $style,
Note: See TracChangeset for help on using the changeset viewer.