Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes conflicts with WPForms plugin #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 5, 2022

  1. Fixes conflicts with WPForms plugin

    If [WPForms](https://wordpress.org/plugins/wpforms-lite/) is installed.
    Fatal error would be thrown and site crashes:
    ```bash
    PHP Warning:  require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
    Warning: require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
    PHP Fatal error:  require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
    Fatal error: require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
    
    ```
    
    The snippet that matters in `wordpress/wp-content/plugins/wpforms/includes/class-providers.php`:
    ```php
    /**
             * Load default marketing providers.
             *
             * @SInCE 1.3.6
             */
            public function load() {
    
                    $providers = array(
                            'constant-contact',
                    );
    
                    $providers = apply_filters( 'wpforms_load_providers', $providers );
    
                    foreach ( $providers as $provider ) {
    
                            $provider = sanitize_file_name( $provider );
    
                            require_once WPFORMS_PLUGIN_DIR . 'includes/providers/class-' . $provider . '.php';
                    }
            }
    }
    ```
    This line: ` $provider = sanitize_file_name( $provider );`
    would turn 
    `class-constant-contact.php` 
    to `class-constant-contact-107517-6m2f19OS.php`. 
    
    This commit would try to rename only media files, not other files like `.php`.
    isimaka authored Apr 5, 2022
    Configuration menu
    Copy the full SHA
    a42736c View commit details
    Browse the repository at this point in the history