flowplayer / wordpress-flowplayer

A plugin for wordpress to show videos with Flowplayer5
http://wordpress.org/plugins/flowplayer5/
GNU General Public License v2.0
13 stars 19 forks source link

Fixing foreach warning from undefined variable #88

Closed MichaelPereiraUK closed 9 years ago

MichaelPereiraUK commented 9 years ago

There is currently a 'Warning: Invalid argument supplied for foreach()' on 404 pages as the variable has never been defined, and doesn't get defined if it's a 404 page.

grappler commented 9 years ago

Thank you very much for the PR. The problem with this change is that there is a line where it is checking if the variable is set so that if the function is called multiple times it only runs once and the result is available in the variable.

I just committed a fix with a few other small improvements. https://github.com/flowplayer/wordpress-flowplayer/commit/05ca12e7336bca17647ab76bc4084ae780d45b02