• Resolved jomo

    (@jonathanmoorebcsorg)


    plugins/social-networks-auto-poster-facebook-twitter-g/inc/nxs_class_snap.php
    tests like this l.975
    $pbo['hideMe'] = $options['hideUnchecked'] && (empty($pbo['do']) || ($pbo['fltrsOn'] == '1' && !in_array($_GET['post_type'],$pbo['fltrs']['post_types'])) ); if (!$pbo['hideMe']) $jXj++;

    and l.979
    <?php $pbo = $ntClInst->nt[$cboInx]; $pbo['jj']=$cboInx; $pbo['cbo']=$cbo; $pbo['hideMe'] = $options['hideUnchecked'] && (empty($pbo['do']) || ($pbo['fltrsOn'] == '1' && !in_array($_GET['post_type'],$pbo['fltrs']['post_types'])) );

    fail if $_GET[‘post_type’] is not set.
    they should be checking isset($_GET[‘post_type’]) before attempting to access it

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jomo

    (@jonathanmoorebcsorg)

    since you have already done
    $post = get_post($post_id)
    at the beginning of the function, you could get the post type there:
    $posttype = $post->post_type;

    and then just use $posttype instead of $_GET[‘post_type’] in the next three tests where it appears
    (there is a third $_GET[‘post_type’] on l.994 as well)

    That doesn’t solve the problem completely as $pbo[‘fltrs’][‘post_types’] is also not set and not tested with isset() and should be

    Thread Starter jomo

    (@jonathanmoorebcsorg)

    for example l.975 would become:
    $pbo['hideMe'] = $options['hideUnchecked'] && (empty($pbo['do']) || ($pbo['fltrsOn'] == '1' && (!isset($pbo['fltrs']['post_types']) || !in_array($posttype,$pbo['fltrs']['post_types']))) ); if (!$pbo['hideMe']) $jXj++;

    Plugin Author NextScripts

    (@nextscripts)

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘unchecked $_GET[‘post_type’] cause errors’ is closed to new replies.