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

Resolved Rollbar error 16746 - missing array key 'extension' #12411

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

uberbrady
Copy link
Collaborator

So we've been getting a lot of these Rollbar errors lately - "missing array key 'extension'"

It turns out that pathinfo() doesn't even return the extension on files that don't have one. While doing an array_key_exists() call is always an option, it turns out there's a flag we can pass that will make it return the extension instead. So I used that.

I confirmed the bug by doing:

php artisan tinker
Psy Shell v0.11.7 (PHP 7.4.33 — cli) by Justin Hileman
>>> pathinfo('fart')['extension']
PHP Notice:  Undefined index: extension in /Users/uberbrady/Documents/grokability/snipe-iteval()'d code on line 1
=> null

>>> pathinfo('fart', PATHINFO_EXTENSION)
=> ""

>>> 

I tested this by running a CLI restore on my local, which worked.

@what-the-diff
Copy link

what-the-diff bot commented Jan 25, 2023

@snipe snipe merged commit f0b1451 into snipe:develop Jan 25, 2023
@snipe
Copy link
Owner

snipe commented Jan 25, 2023

Looks great - thanks Brady!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants