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

Commit e179851

Browse files
authored
Merge pull request #56 from TheCrowned/fix-fatal-46
Fixed fatal error in PHP < 5.4
2 parents 0e69816 + 1fc0b06 commit e179851

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

includes/class-creativecommons-image.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ function add_image_license_metadata($form_fields, $post)
295295

296296
function save_image_license_metadata($post, $attachment)
297297
{
298-
foreach (['license_url', 'attribution_url', 'source_work_url',
299-
'extra_permissions_url'] as $field) {
298+
$image_meta = array( 'license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url' );
299+
foreach ( $image_meta as $field ) {
300300
if (isset($attachment[$field])) {
301301
update_post_meta(
302302
$post['ID'],
@@ -305,7 +305,9 @@ function save_image_license_metadata($post, $attachment)
305305
);
306306
}
307307
}
308-
foreach (['attribution_name'] as $field) {
308+
309+
$image_meta_no_sanitization = array( 'attribution_name' );
310+
foreach ( $image_meta_no_sanitization as $field ) {
309311
if (isset($attachment[$field])) {
310312
update_post_meta(
311313
$post['ID'],

0 commit comments

Comments
 (0)