Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Conversation

@TheCrowned
Copy link
Contributor

This fixes the fatal error reported in issue #46. The problem was due to the syntax used for defining an array in function save_image_license_metadata(), where we did

foreach ( ['license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url'] as $field) {

However, this compact syntax is only supported by PHP > 5.4. Officially, WordPress supports up to PHP 5.2, and since there is an equivalent syntax that works just the same, I updated the files to use the backwards-compatible one :)

foreach ( array( 'license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url' ) as $field) {

No change in function whatsoever, tested in my local setup by updating the license details of a media item and checking that they did indeed get through.

Fixed fatal error in PHP < 5.4 due to unsupported syntax for defining an array (issue #46).
@TheCrowned TheCrowned mentioned this pull request Mar 19, 2019
@kgodey kgodey requested a review from hugosolar March 19, 2019 15:59
@hugosolar hugosolar merged commit e179851 into cc-archive:develop Mar 27, 2019
@TheCrowned TheCrowned deleted the fix-fatal-46 branch March 30, 2019 10:50
@brylie
Copy link
Contributor

brylie commented Oct 11, 2021

@all-contributors add @TheCrowned for code

@allcontributors
Copy link
Contributor

@brylie

I've put up a pull request to add @TheCrowned! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants