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

PHP 8.2 - null to string conversion deprecation issue in Zend_Validate_File_Extension #351

Closed
pisc-software opened this issue Jun 1, 2023 · 6 comments
Assignees
Labels
bug Something isn't working to be released PR exists or in master, but not released yet
Milestone

Comments

@pisc-software
Copy link

Zend_Validate_File_Extension needs a fix where a string variable is set to null in the class, throwing deprecation messages as on PHP 8.2 the null value is not automatically converted to an empty string anymore:

File: lib/Zend/Validate/File/Extension.php (135)
    /**
     * Sets the file extensions
     *
     * @param  string|array $extension The extensions to validate
     * @return Zend_Validate_File_Extension Provides a fluent interface
     */
    public function setExtension($extension)
    {
        // FIX: Set _extension to empty string instead of null
        $this->_extension = '';
        $this->addExtension($extension);
        return $this;
    }
@hungtrinh
Copy link

@pisc-software please feel free to make PR

@develart-projects develart-projects added the bug Something isn't working label Aug 9, 2023
@develart-projects develart-projects self-assigned this Aug 10, 2023
@develart-projects
Copy link
Collaborator

develart-projects commented Aug 10, 2023

I'm on it. You can't simply change to empty string, because there is null comparsion in the code.

@develart-projects
Copy link
Collaborator

Validator is screwed up a bit more than expected, by previous commits. Once setting string, then expecting array, then null. I'll revert recent updates and fix the problem itself, as described.

@develart-projects develart-projects added this to the 1.23.0 milestone Aug 10, 2023
develart-projects added a commit to develart-projects/zf1-future that referenced this issue Aug 10, 2023
@develart-projects develart-projects added the to be released PR exists or in master, but not released yet label Aug 10, 2023
@develart-projects
Copy link
Collaborator

Started to rework the validator, then backed up and kept simplest approach.
#364

@develart-projects
Copy link
Collaborator

1.23.0 released

@pisc-software
Copy link
Author

Thank you for the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to be released PR exists or in master, but not released yet
Projects
None yet
Development

No branches or pull requests

3 participants