Undefined index: url & file
-
Good day,
I noticed in my error log the following two errors appearing many times.
- PHP Notice: Undefined index: url in …/wp/wp-content/plugins/hummingbird-performance/core/modules/minify/class-minify-group.php on line 1226
- PHP Notice: Undefined index: file in …/wp/wp-content/plugins/hummingbird-performance/core/modules/minify/class-minify-group.php on line 1229
I fixed it by changing the code from
$url = empty( $suffix ) ? $upload['url'] : str_replace( $suffix, '', $upload['url'] ); update_post_meta( $group->file_id, '_url', $url ); update_post_meta( $group->file_id, '_path', $upload['file'] );
to
if ( array_key_exists( 'url', $upload ) && array_key_exists( 'file', $upload ) ) { $url = empty( $suffix ) ? $upload['url'] : str_replace( $suffix, '', $upload['url'] ); update_post_meta( $group->file_id, '_url', $url ); update_post_meta( $group->file_id, '_path', $upload['file'] ); }
Maybe you could change this too in the next release?
Kind regards,
Irian
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Undefined index: url & file’ is closed to new replies.