Warning: Undefined Index ‘refersion_status’
-
Hello,
I’d like to report a small bug that’s causing PHP warnings when Refersion is set to “No, turn off Refersion reporting”.
On the front-end of my site, I’m getting the warning: “Undefined index: refersion_status” on lines 125 and 150 of /refersion-for-woocommerce/class.refersion.php
https://plugins.trac.wordpress.org/browser/refersion-for-woocommerce/trunk/class.refersion.php#L125
https://plugins.trac.wordpress.org/browser/refersion-for-woocommerce/trunk/class.refersion.php#L150This problem only happens when I select “No, turn off Refersion reporting” in the admin panel.
I suspect that it is happening because of the use of
!empty()
in the sanitize function on line 241 of class.refersion-admin.phpThe select option for “No, turn off Refersion reporting” is zero and the integer zero counts as empty.
I locally changed this
!empty()
toisset()
and the zero was correctly saved to the database, so$options['refersion_status']
becomes a defined index.Thanks!
- The topic ‘Warning: Undefined Index ‘refersion_status’’ is closed to new replies.