protected function isValid()
    {
        if (!$this->request->ajax()) {
            return false;
        }
        $search = $this->request->input('search');
        if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
            return false;
        }
        $token = $this->request->header('search-protection');
        if (!$this->validateToken($token)) {
            return false;
        }
        return true;
    }
protected function isValid()
    {
        if (!$this->request->ajax()) {
            return false;
        }
        $search = $this->request->input('search');
        if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
            return false;
        }
        $token = $this->request->header('search-protection');
        if (!$this->validateToken($token)) {
            return false;
        }
        return true;
    }
protected function isValid ( ) { if ( ! $ this -> request -> ajax ( ) ) { return false ; } $ search = $ this -> request -> input ( 'search' ) ; if ( ! is_string ( $ search ) or strlen ( $ this -> request -> input ( 'search' ) ) <= 0 ) { return false ; } $ token = $ this -> request -> header ( 'search-protection' ) ; if ( ! $ this -> validateToken ( $ token ) ) { return false ; } return true ; }
validates submitted data from search form

@return boolean
validates submitted data from search form