Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


namespace Events;

class Filter
{
    protected $cp;
    protected $currentScreen;
    public function __construct()
    {
        $this->cp = (isset($_GET['cp'])) ? $_GET['cp'] : '';
	add_filter('disable_months_dropdown', [$this, 'disableMonthsFilter'], 10, 1);
	add_action('restrict_manage_posts', [$this, 'echoFilterHtml']);
	add_filter('parse_query', [$this, 'modifySqlQuery'], 10, 1);
}
    public function disableMonthsFilter($post_type)
    {
        return true;
    }
    public function echoFilterHtml()
    {
        $html = '<select name="cp">\n";
        $html .= '<option value="current" selected>Current events</option>\n";
        $html .= '<option value="past" ';
        $html .= ($this->cp == 'past') ? 'selected' : '';
        $html .= '>Past events</option>\n";
        $html .= '<option value="all" ';
        $html .= ($this->cp == 'all') ? 'selected' : '';
        $html .= '>All events</option>\n";
        $html .= '</select>\n";
        echo $html;
    }

    public function modifySqlQuery($query)
    {
        if (!$this->cp || ($this->cp != 'all')) {
            $now = date('Y-m-d H:i:s');
            $compare = ($this->cp == 'past') ? '<' : '>';
            $query->set('meta_query', [['key' => '_EventEndDate', 'value' => $now, 'compare' => $compare]]);
        }
    }
}



© 2023 Quttera Ltd. All rights reserved.