keepassphp/lib/protectedxmlreader.php
public function readTextInside($asProtectedString = false)
	{
		if($this->_state != self::GO_ON || $this->r->isEmptyElement)
			return null;
		$isProtected = $this->r->hasAttributes &&
			$this->r->getAttribute(self::XML_ATTR_PROTECTED) == self::XML_ATTR_TRUE;
		
		if(!@$this->r->read())
		{
			$this->_state = self::STOP;
			return null;
		}

		if($this->r->nodeType == \XMLReader::TEXT)
		{
			$value = $this->r->value;
			if(!$isProtected || empty($value) || $this->_randomStream == null)
				return $asProtectedString
					? new UnprotectedString($value)
					: $value;
			$value = base64_decode($value);
			$random = $this->_randomStream->getNextBytes(strlen($value));
			return $asProtectedString
				? new ProtectedString($value, $random)
				: $value ^ $random;
		}
		elseif($this->r->nodeType == \XMLReader::ELEMENT)
		{
			$this->_state = self::DO_NOT_READ;
			return null;
		}
	}
public function readTextInside($asProtectedString = false)
	{
		if($this->_state != self::GO_ON || $this->r->isEmptyElement)
			return null;
		$isProtected = $this->r->hasAttributes &&
			$this->r->getAttribute(self::XML_ATTR_PROTECTED) == self::XML_ATTR_TRUE;
		
		if(!@$this->r->read())
		{
			$this->_state = self::STOP;
			return null;
		}

		if($this->r->nodeType == \XMLReader::TEXT)
		{
			$value = $this->r->value;
			if(!$isProtected || empty($value) || $this->_randomStream == null)
				return $asProtectedString
					? new UnprotectedString($value)
					: $value;
			$value = base64_decode($value);
			$random = $this->_randomStream->getNextBytes(strlen($value));
			return $asProtectedString
				? new ProtectedString($value, $random)
				: $value ^ $random;
		}
		elseif($this->r->nodeType == \XMLReader::ELEMENT)
		{
			$this->_state = self::DO_NOT_READ;
			return null;
		}
	}
public function readTextInside ( $ asProtectedString = false ) { if ( $ this -> _state != self :: GO_ON || $ this -> r -> isEmptyElement ) return null ; $ isProtected = $ this -> r -> hasAttributes && $ this -> r -> getAttribute ( self :: XML_ATTR_PROTECTED ) == self :: XML_ATTR_TRUE ; if ( ! @ $ this -> r -> read ( ) ) { $ this -> _state = self :: STOP ; return null ; } if ( $ this -> r -> nodeType == \ XMLReader :: TEXT ) { $ value = $ this -> r -> value ; if ( ! $ isProtected || empty ( $ value ) || $ this -> _randomStream == null ) return $ asProtectedString ? new UnprotectedString ( $ value ) : $ value ; $ value = base64_decode ( $ value ) ; $ random = $ this -> _randomStream -> getNextBytes ( strlen ( $ value ) ) ; return $ asProtectedString ? new ProtectedString ( $ value , $ random ) : $ value ^ $ random ; } elseif ( $ this -> r -> nodeType == \ XMLReader :: ELEMENT ) { $ this -> _state = self :: DO_NOT_READ ; return null ; } }
Reads the text content of the current Element node.
@param $asProtectedString Whether to return an iBoxedString instance
rather than a plain string.
@return The text content if it exists, or null.
Reads the text content of the current Element node .