Base::devoid PHP Méthode

devoid() public méthode

Return TRUE if hive key is empty and not cached
public devoid ( $key, &$val = NULL ) : boolean
$key string
$val mixed
Résultat boolean
    function devoid($key, &$val = NULL)
    {
        $val = $this->ref($key, FALSE);
        return empty($val) && (!Cache::instance()->exists($this->hash($key) . '.var', $val) || !$val);
    }

Usage Example

 /**
  * @param \Base $f3
  * @param array $params
  */
 public function viewSingle(\Base $f3, $params)
 {
     $web = \Web::instance();
     $this->response->data['SUBPART'] = 'larfi_page.html';
     if (isset($params['id'])) {
         $this->resource->load(array('_id = ?', $params['id']));
         $this->response->data['POST'] = $this->resource;
         if ($this->resource->dry()) {
             $f3->error(404, 'LFI Plugin not found');
         } else {
             $this->response->data['SUBPART'] = 'larfi_page.html';
             $url = $f3->get('POST.url');
             $blankurl = $f3->devoid('POST.url');
             $lfi_type = $f3->get('POST.lType');
             $payload = $f3->get('POST.lPayload');
             $method = $f3->get('POST.lMethod');
             switch ($lfi_type) {
                 case "Generic":
                     \Flash::instance()->addMessage('Exploited by injecting into the URL/Body where applicable', 'info');
                     return $this->uri_based_lfi($method, $blankurl, $url, $payload);
                     break;
                 case "Cookie":
                     \Flash::instance()->addMessage('Exploited by injecting into the cookie', 'info');
                     return $this->cookie_based_lfi($method, $blankurl, $url, $payload);
                     break;
                 default:
                     \Flash::instance()->addMessage('This is an invalid attack type', 'warning');
             }
         }
     }
 }
All Usage Examples Of Base::devoid