Author: chabotc
Date: Sun Jul 13 06:02:09 2008
New Revision: 676313
URL: http://svn.apache.org/viewvc?rev=676313&view=rev
Log:
Doh, offset by one mistake in the paging link & title, plus it seems
createTextNode already does html escaping by it's self
Modified:
incubator/shindig/trunk/php/src/socialrest/converters/OutputAtomConverter.php
Modified:
incubator/shindig/trunk/php/src/socialrest/converters/OutputAtomConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/socialrest/converters/OutputAtomConverter.php?rev=676313&r1=676312&r2=676313&view=diff
==============================================================================
---
incubator/shindig/trunk/php/src/socialrest/converters/OutputAtomConverter.php
(original)
+++
incubator/shindig/trunk/php/src/socialrest/converters/OutputAtomConverter.php
Sun Jul 13 06:02:09 2008
@@ -54,7 +54,7 @@
$entry = $this->addNode($doc, 'feed', '', false,
self::$nameSpace);
// Required Atom fields
- $this->addNode($entry, 'title', $requestType.' feed for
id '.$authorName.' ('.$startIndex. ' - '. ($startIndex + $itemsPerPage).' of
'.$totalResults.')');
+ $this->addNode($entry, 'title', $requestType.' feed for
id '.$authorName.' ('.$startIndex. ' - '. (($startIndex + $itemsPerPage) - 1).'
of '.$totalResults.')');
$author = $this->addNode($entry, 'author');
$this->addNode($author, 'uri', $guid);
$this->addNode($author, 'name', $authorName);
@@ -179,7 +179,7 @@
}
// Create a 'next' link based on our current url if this is a
pageable collection & there is more to display
if (($startIndex + $itemsPerPage) < $totalResults) {
- $nextStartIndex = $startIndex + $itemsPerPage;
+ $nextStartIndex = ($startIndex + $itemsPerPage) - 1;
if (($uri = $_SERVER['REQUEST_URI']) === false) {
throw new Exception("Could not parse URI :
{$_SERVER['REQUEST_URI']}");
}
@@ -254,15 +254,15 @@
$this->addData($newElement, $key, $val);
} else {
$elm =
$newElement->appendChild($this->doc->createElement($key));
-
$elm->appendChild($this->doc->createTextNode(htmlentities($val, ENT_NOQUOTES,
'UTF-8')));
+
$elm->appendChild($this->doc->createTextNode($val));
}
}
} elseif (is_object($data)) {
if ($data instanceof Enum) {
// enums are output as : <NAME
key="$key">$displayValue</NAME>
$keyEntry =
$newElement->appendChild($this->doc->createAttribute('key'));
-
$keyEntry->appendChild($this->doc->createTextNode(htmlentities($data->key,
ENT_NOQUOTES, 'UTF-8')));
-
$newElement->appendChild($this->doc->createTextNode(htmlentities($data->getDisplayValue(),
ENT_NOQUOTES, 'UTF-8')));
+
$keyEntry->appendChild($this->doc->createTextNode($data->key));
+
$newElement->appendChild($this->doc->createTextNode($data->getDisplayValue()));
} else {
$vars = get_object_vars($data);
@@ -275,12 +275,12 @@
$this->addData($newElement,
$key, $val);
} else {
$elm =
$newElement->appendChild($this->doc->createElement($key));
-
$elm->appendChild($this->doc->createTextNode(htmlentities($val, ENT_NOQUOTES,
'UTF-8')));
+
$elm->appendChild($this->doc->createTextNode($val));
}
}
}
} else {
-
$newElement->appendChild($this->doc->createTextNode(htmlentities($data,
ENT_NOQUOTES, 'UTF-8')));
+
$newElement->appendChild($this->doc->createTextNode($data));
}
return $newElement;
}