Notice of “Undefined index: enclosure_url” causing errors
-
I’ve been working on a site that’s been losing data on post updates that were previously good — it looks like this notice has been propagating into the javascript and causing errors, which resulted in
Powerpress[podcast][url]
to be rewritten to<br />
which causes all sorts of errors.Looks like it’s been in since version 9 —
but that echo is the only occurrence of
enclosure_url
in the plugin. I assume it’s a key in the response data frompowerpress_get_media_info()
but if! $hosting
thenpowerpress_get_media_info_local()
wouldn’t return it — causing the notice, which getting parsed in javascript causes an error, which overwrites the url with the returned html tag, as the full response looked like:VERIFY-OK podcast 17656904 0:36:01 <br /> <b>Notice</b>: Undefined index: enclosure_url in <b>/srv/htdocs/wp-content/plugins/powerpress/powerpressadmin.php</b> on line <b>3354</b><br />
I’d strongly suggest swapping that line out to only conditionally echo
if ( isset( $MediaInfo['enclosure_url'] ) )
- The topic ‘Notice of “Undefined index: enclosure_url” causing errors’ is closed to new replies.