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

Fixed passing invalid argument to strpos() #13456

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

marcusmoore
Copy link
Collaborator

Description

I noticed a couple tests failing when run on PHP 7.4 due to an empty string being passed as the second parameter to strpos() which isn't valid pre-8.0.

This small PR moves the existing $prefix == '' up so calling strpos is skipped if the prefix is an empty string.

@uberbrady can you double-check this makes sense please?

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@what-the-diff
Copy link

what-the-diff bot commented Aug 14, 2023

PR Summary

  • Improved Asset Creation Procedure in AssetObserver.php
    We have modified the 'created' method logic in AssetObserver.php to ensure a better asset creation process. Now it checks if the 'auto_increment_assets' option is activated and if the prefix accurately matches the start of the tag. This change also accommodates cases where there might be no prefix. This should improve the reliability and accuracy of automatic asset creation.

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very elegant and clean fix, makes total sense to me! Great catch!

@snipe snipe merged commit 79a4d91 into snipe:develop Aug 21, 2023
@marcusmoore marcusmoore deleted the fixes/auto-incrementing-on-74 branch August 21, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants