Skip to content

Commit

Permalink
Better variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Dec 15, 2014
1 parent 265ea91 commit 8484798
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions framework/ActiveSync/lib/Horde/ActiveSync/Request/SyncBase.php
Expand Up @@ -30,58 +30,58 @@ abstract class Horde_ActiveSync_Request_SyncBase extends Horde_ActiveSync_Reques
/**
* Parse incoming BODYPARTPREFERENCE options.
*
* @param array $collection An array structure to parse the data into.
* @param array $options An array structure to parse the data into.
*/
protected function _bodyPartPrefs(&$collection)
protected function _bodyPartPrefs(&$options)
{
$collection['bodypartprefs'] = array();
$options['bodypartprefs'] = array();
if ($this->_decoder->getElementStartTag(Horde_ActiveSync::AIRSYNCBASE_TYPE)) {
$collection['bodypartprefs']['type'] = $this->_decoder->getElementContent();
$options['bodypartprefs']['type'] = $this->_decoder->getElementContent();
// MS-ASAIRS 2.2.2.22.3 type MUST be BODYPREF_TYPE_HTML
if (!$this->_decoder->getElementEndTag() ||
$collection['bodypartprefs']['type'] != Horde_ActiveSync::BODYPREF_TYPE_HTML) {
$options['bodypartprefs']['type'] != Horde_ActiveSync::BODYPREF_TYPE_HTML) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
if ($this->_decoder->getElementStartTag(Horde_ActiveSync::AIRSYNCBASE_TRUNCATIONSIZE)) {
$collection['bodypartprefs']['truncationsize'] = $this->_decoder->getElementContent();
$options['bodypartprefs']['truncationsize'] = $this->_decoder->getElementContent();
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}

if ($this->_decoder->getElementStartTag(Horde_ActiveSync::AIRSYNCBASE_ALLORNONE)) {
$collection['bodypartprefs']['allornone'] = $this->_decoder->getElementContent();
$options['bodypartprefs']['allornone'] = $this->_decoder->getElementContent();
// MS-ASAIRS 2.2.2.1.1 - MUST be ignored if no trunction
// size is set. Note we still must read it if it sent
// so reading the wbxml stream does not break.
if (empty($collection['bodypartprefs']['truncationsize'])) {
unset($collection['bodypartprefs']['allornone']);
if (empty($options['bodypartprefs']['truncationsize'])) {
unset($options['bodypartprefs']['allornone']);
}
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
if ($this->_decoder->getElementStartTag(Horde_ActiveSync::AIRSYNCBASE_PREVIEW)) {
$collection['bodypartprefs']['preview'] = $this->_decoder->getElementContent();
$options['bodypartprefs']['preview'] = $this->_decoder->getElementContent();
// MS-ASAIRS 2.2.2.18.3 - Max size of preview is 255.
if (!$this->_decoder->getElementEndTag() ||
$collection['bodypartprefs']['preview'] > 255) {
$options['bodypartprefs']['preview'] > 255) {

$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
Expand All @@ -91,18 +91,18 @@ protected function _bodyPartPrefs(&$collection)
*
* @param array An array structure to parse the values into.
*/
protected function _bodyPrefs(&$collection)
protected function _bodyPrefs(&$options)
{
$body_pref = array();
if (empty($collection['bodyprefs'])) {
$collection['bodyprefs'] = array();
if (empty($options['bodyprefs'])) {
$options['bodyprefs'] = array();
}
while (1) {
if ($this->_decoder->getElementStartTag(Horde_ActiveSync::AIRSYNCBASE_TYPE)) {
$body_pref['type'] = $this->_decoder->getElementContent();
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
Expand All @@ -111,7 +111,7 @@ protected function _bodyPrefs(&$collection)
$body_pref['truncationsize'] = $this->_decoder->getElementContent();
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
Expand All @@ -120,7 +120,7 @@ protected function _bodyPrefs(&$collection)
$body_pref['allornone'] = $this->_decoder->getElementContent();
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}
Expand All @@ -129,15 +129,15 @@ protected function _bodyPrefs(&$collection)
$body_pref['preview'] = $this->_decoder->getElementContent();
if (!$this->_decoder->getElementEndTag()) {
$this->_statusCode = self::STATUS_PROTERROR;
$this->_handleError($collection);
$this->_handleError($options);
exit;
}
}

$e = $this->_decoder->peek();
if ($e[Horde_ActiveSync_Wbxml::EN_TYPE] == Horde_ActiveSync_Wbxml::EN_TYPE_ENDTAG) {
$this->_decoder->getElementEndTag();
$collection['bodyprefs'][$body_pref['type']] = $body_pref;
$options['bodyprefs'][$body_pref['type']] = $body_pref;
break;
}
}
Expand Down

0 comments on commit 8484798

Please sign in to comment.