Notices regarding undefined indexes
-
Great plugin. Thank you. There is a minor issue with PHP messages being reported.
I’ve included below the messages and a diff listing for the two modifications I’ve made to the javascript_per_page.php file. Will a similar mod be made in an upcoming release?
Thank you
[14-May-2016 22:42:40 UTC] PHP Notice: Undefined index: add_ie_javascripts in /var/www/tec-dev.parrot-consulting.com/wp-content/plugins/javascript-per-page/javascript_per_page.php on line 199
[14-May-2016 22:42:40 UTC] PHP Notice: Undefined index: add_ios_javascript in /var/www/tec-dev.parrot-consulting.com/wp-content/plugins/javascript-per-page/javascript_per_page.php on line 203Index: javascript_per_page.php
===================================================================
— javascript_per_page.php (revision 329)
+++ javascript_per_page.php (working copy)
@@ -196,11 +196,11 @@$javascriptPerPage = get_option(‘javascriptPerPage’);
– if (!is_admin() && $javascriptPerPage[‘add_ie_javascripts’] == ‘on’){
+ if (!is_admin() && ! empty($javascriptPerPage[‘add_ie_javascripts’]) && $javascriptPerPage[‘add_ie_javascripts’] == ‘on’){
addIEJavascripts();
}– if (!is_admin() && $javascriptPerPage[‘add_ios_javascript’] == ‘on’){
+ if (!is_admin() && ! empty($javascriptPerPage[‘add_ios_javascript’]) && $javascriptPerPage[‘add_ios_javascript’] == ‘on’){
addIosJavascript();
}
}
The topic ‘Notices regarding undefined indexes’ is closed to new replies.