WordPress.org

Ready to get started?Download WordPress

Forums

Email Log
[resolved] Notices undefined indices (4 posts)

  1. ZjanPreijde
    Member
    Posted 2 years ago #

    Hi Sudar,

    It's a tiny issue, but when using it in my development environment, I get 6 notices like Notice: Undefined index: emaillog_page in /home/....../wp-content/plugins/email-log/email-log.php on line 194 because you're using intval($_GET['emaillog_page']) without checking isset($_GET['emaillog_page']).

    Again, it's a tiny issue, but easy to avoid.

    But thanks for a very nice plugin, I was wondering (as a new user) where WP left it's sent emails, but apparantly it doesn't.

    Greetz, Zjan

    http://wordpress.org/extend/plugins/email-log/

  2. Sudar
    Member
    Plugin Author

    Posted 2 years ago #

    Nice to know that you like the Plugin.

    If you can list down all the 6 notices, I will fix it as part of the next release.

  3. ZjanPreijde
    Member
    Posted 2 years ago #

    Hi Sudar,

    This is how I changed your code to avoid the notices:

    function settings_page() {
            global $wpdb;
            global $text_direction;
    
            $base_name = plugin_basename('email-log');
            $base_page = 'admin.php?page='.$base_name;
    
    //      $email_log_page            = intval($_GET['emaillog_page']);
            $email_log_page            = (isset($_GET['emaillog_page'])) ? intval($_GET['emaillog_page']) : 0;
    //      $emaillogs_filterid        = trim(addslashes($_GET['id']));
            $emaillogs_filterid        = (isset($_GET['id'])) ? trim(addslashes($_GET['id'])) : "" ;
    //      $emaillogs_filter_to_email = trim(addslashes($_GET['to_email']));
            $emaillogs_filter_to_email = (isset($_GET['to_email'])) ? trim(addslashes($_GET['to_email'])) : "" ;
    //      $emaillogs_filter_subject  = trim(addslashes($_GET['subject']));
            $emaillogs_filter_subject  = (isset($_GET['subject'])) ? trim(addslashes($_GET['subject'])) : "" ;
    //      $emaillog_sort_by          = trim($_GET['by']);
            $emaillog_sort_by          = (isset($_GET['by'])) ? trim($_GET['by']) : "";
            $emaillog_sortby_text      = '';
    //      $emaillog_sortorder        = trim($_GET['order']);
            $emaillog_sortorder        = (isset($_GET['order'])) ? trim($_GET['order']) : "" ;
            $emaillog_sortorder_text   = '';
            $email_log_perpage         = intval($this->get_per_page());
            $emaillog_sort_url         = '';

    Grtz, Zjan

    http://wordpress.org/extend/plugins/email-log/

  4. Sudar
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks. I fixed it in v0.8 of the Plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags