protected function _preProcess($resource)
    {
        // clear file / directory stats
        clearstatcache();

        // calculate hash
        $uid = $this->_getUid($resource);

        // already processed in current stack?
        if (!isset($this->resources[$uid])) {
            // remove trailing trash ...
            $resource = trim($resource, "\t\r\n\0\x0B");

            // check for containing BAD-stuff
            $this->_nullByteCheck($resource);

            // store the information
            $this->resources[$uid] = array(
                'resource' => $resource,
                'uid'      => $uid,
                'safe'     => true
            );
        }

        // map data to currentResource
        $this->setCurrentResourceInformation($this->resources[$uid]);

        // return safe resource
        return $resource;
    }
protected function _preProcess($resource)
    {
        // clear file / directory stats
        clearstatcache();

        // calculate hash
        $uid = $this->_getUid($resource);

        // already processed in current stack?
        if (!isset($this->resources[$uid])) {
            // remove trailing trash ...
            $resource = trim($resource, "\t\r\n\0\x0B");

            // check for containing BAD-stuff
            $this->_nullByteCheck($resource);

            // store the information
            $this->resources[$uid] = array(
                'resource' => $resource,
                'uid'      => $uid,
                'safe'     => true
            );
        }

        // map data to currentResource
        $this->setCurrentResourceInformation($this->resources[$uid]);

        // return safe resource
        return $resource;
    }
protected function _preProcess ( $ resource ) { // clear file / directory stats clearstatcache ( ) ; // calculate hash $ uid = $ this -> _getUid ( $ resource ) ; // already processed in current stack? if ( ! isset ( $ this -> resources [ $ uid ] ) ) { // remove trailing trash ... $ resource = trim ( $ resource , "\t\r\n\0\x0B" ) ; // check for containing BAD-stuff $ this -> _nullByteCheck ( $ resource ) ; // store the information $ this -> resources [ $ uid ] = array ( 'resource' => $ resource , 'uid' => $ uid , 'safe' => true ) ; } // map data to currentResource $ this -> setCurrentResourceInformation ( $ this -> resources [ $ uid ] ) ; // return safe resource return $ resource ; }
Basic processing of a resource

This method is intend to retrieve basic information about a file and protects the filesystem

@param string $resource The resource to process (can be either folder or file)

@author Benjamin Carl <opensource@clickalicious.de>
@return string The clean and safe resource name
@access protected
Basic processing of a resource