checkFile example


    public static function loadFile($path$check = true)
    {
        if ($check && !self::checkFile($path)) {
            throw new Enlight_Exception('Security check: Illegal character in filename');
        }
        if ($check && !self::isReadable($path)) {
            throw new Enlight_Exception('File "' . $path . '" not exists failure');
        }
        if (!ob_start()) {
            throw new Enlight_Exception('Output buffering could not be started');
        }

        $result = include $path;
        ob_end_clean();

        

class MTimeProtectedFileStorage extends MTimeProtectedFastFileStorage {

  /** * {@inheritdoc} */
  public function load($name) {
    if (($filename = $this->checkFile($name)) !== FALSE) {
      // Inline parent::load() to avoid an expensive getFullPath() call.       return (@include_once $filename) !== FALSE;
    }
    return FALSE;
  }

  /** * {@inheritdoc} */
  public function exists($name) {
    return $this->checkFile($name) !== FALSE;
  }
Home | Imprint | This part of the site doesn't use cookies.