. ' "' . $this->db->sql_escape($value) .'"'
. $range;
- if (!($dbresult = & $this->db->sql_query_limit($query, 1, 0))) {
+ if (!($dbresult = $this->db->sql_query_limit($query, 1, 0))) {
message_die(
GENERAL_ERROR,
'Could not get bookmark', '', __LINE__, __FILE__,
. $query_2
.' WHERE B.bId = '. $this->db->sql_escape($bid);
- if (!($dbresult = & $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
message_die(
GENERAL_ERROR, 'Could not get bookmark',
'', __LINE__, __FILE__, $sql, $this->db
. ' WHERE bId = ' . intval($bId);
$this->db->sql_transaction('begin');
- if (!($dbresult = & $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(
GENERAL_ERROR, 'Could not update bookmark',
$sql = 'INSERT INTO '. $this->getTableName()
. ' ' . $this->db->sql_build_array('INSERT', $values);
- if (!($dbresult =& $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(
GENERAL_ERROR, 'Could not attach tags',
$query.= ' AND '. $bs->getTableName() .'.uId = '. $uId;
$query.= ' AND '. $this->getTableName() .'.tag = "'. $this->db->sql_escape($tag) .'"';
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query = 'DELETE FROM '. $this->getTableName() .' WHERE bId = '. intval($bookmarkid);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$GLOBALS['tableprefix'].'bookmarks',
$uId);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query .= ' WHERE '. $this->db->sql_build_array('SELECT', $conditions) .' AND LEFT(T.tag, 7) <> "system:" GROUP BY T.tag ORDER BY bCount DESC, tag';
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query_5 = ' AND LEFT(T0.tag, 7) <> "system:" GROUP BY T0.tag ORDER BY bCount DESC, T0.tag';
$query = $query_1 . $query_2 . $query_3 . $query_4 . $query_5;
- if (! ($dbresult =& $this->db->sql_query_limit($query, $limit)) ){
+ if (! ($dbresult = $this->db->sql_query_limit($query, $limit)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query = 'SELECT T.tag, COUNT(T.tag) AS bCount FROM '.$GLOBALS['tableprefix'].'bookmarks AS B LEFT JOIN '.$GLOBALS['tableprefix'].'bookmarks2tags AS T ON B.bId = T.bId WHERE B.bHash = \''. $this->db->sql_escape($hash) .'\' '. $privacy .'AND LEFT(T.tag, 7) <> "system:" GROUP BY T.tag ORDER BY bCount DESC';
- if (!($dbresult =& $this->db->sql_query_limit($query, $limit))) {
+ if (!($dbresult = $this->db->sql_query_limit($query, $limit))) {
message_die(GENERAL_ERROR, 'Could not get related tags for this hash', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
function hasTag($bookmarkid, $tag) {
$query = 'SELECT COUNT(*) AS tCount FROM '. $this->getTableName() .' WHERE bId = '. intval($bookmarkid) .' AND tag ="'. $this->db->sql_escape($tag) .'"';
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(GENERAL_ERROR, 'Could not find tag', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
- if ($row =& $this->db->sql_fetchrow($dbresult)) {
+ if ($row = $this->db->sql_fetchrow($dbresult)) {
if ($row['tCount'] > 0) {
$output = true;
}
return false;
// Find bookmarks with old tag
- $bookmarksInfo =& $bookmarkservice->getBookmarks(0, NULL, $userid, $old);
- $bookmarks =& $bookmarksInfo['bookmarks'];
+ $bookmarksInfo = $bookmarkservice->getBookmarks(0, NULL, $userid, $old);
+ $bookmarks = $bookmarksInfo['bookmarks'];
// Delete old tag
$this->deleteTag($userid, $old);
$new = $tagservice->normalize($new);
foreach(array_keys($bookmarks) as $key) {
- $row =& $bookmarks[$key];
+ $row = $bookmarks[$key];
$this->attachTags($row['bId'], $new, $fromApi, NULL, false);
}
$values = array('tag'=>$tag, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime);
$sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values);
- if (!($dbresult =& $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add tag description', '', __LINE__, __FILE__, $sql, $this->db);
return false;
$query.= ' WHERE tag=\'' . $this->db->sql_escape($tag) . "'";
$query.= " ORDER BY cdDatetime DESC";
- if (!($dbresult = & $this->db->sql_query_limit($query, 1, 0))) {
+ if (!($dbresult = $this->db->sql_query_limit($query, 1, 0))) {
message_die(GENERAL_ERROR, 'Could not get tag description', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= ' WHERE tag=\'' . $this->db->sql_escape($tag) . "'";
$query.= " ORDER BY cdDatetime DESC";
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tag descriptions', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " FROM `". $this->getTableName() ."`";
$query.= ' WHERE cdId=\'' . $this->db->sql_escape($cdId) . "'";
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tag descriptions', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
- if ($row =& $this->db->sql_fetchrow($dbresult)) {
+ if ($row = $this->db->sql_fetchrow($dbresult)) {
$this->db->sql_freeresult($dbresult);
return $row;
} else {
$values = array('bHash'=>$bHash, 'cdTitle'=>$title, 'cdDescription'=>$desc, 'uId'=>$uId, 'cdDatetime'=>$datetime);
$sql = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values);
- if (!($dbresult =& $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add bookmark description', '', __LINE__, __FILE__, $sql, $this->db);
return false;
$query.= ' WHERE bHash=\'' . $this->db->sql_escape($bHash) . "'";
$query.= " ORDER BY cdDatetime DESC";
- if (!($dbresult = & $this->db->sql_query_limit($query, 1, 0))) {
+ if (!($dbresult = $this->db->sql_query_limit($query, 1, 0))) {
message_die(GENERAL_ERROR, 'Could not get bookmark description', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= ' WHERE bHash=\'' . $this->db->sql_escape($bHash) . "'";
$query.= " ORDER BY cdDatetime DESC";
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get bookmark descriptions', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query = 'DELETE FROM '. $this->getTableName() . ' WHERE uId = '. intval($uId);
$this->db->sql_transaction('begin');
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not delete user descriptions', '',
__LINE__, __FILE__, $query, $this->db);
{
$sql = 'SELECT COUNT(*) AS `total` FROM '. $this->getTableName();
if (!($dbresult = $this->db->sql_query($sql))
- || (!($row = & $this->db->sql_fetchrow($dbresult)))
+ || (!($row = $this->db->sql_fetchrow($dbresult)))
) {
message_die(
GENERAL_ERROR, 'Could not get total searches',
$query.= ' WHERE tag = \''. $this->db->sql_escape($tag) . "'";
$query.= ' AND uId = ' . intval($uId);
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tag description', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= ' WHERE tag = \'' . $this->db->sql_escape($tag) . "'";
$query.= ' AND uId = "' . intval($uId) . '"';
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tag description', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= ' FROM '.$this->getTableName();
$query.= ' WHERE tag = \''. $this->db->sql_escape($tag) . "'";
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not get tag description', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
}
$this->db->sql_transaction('begin');
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
- function __construct(&$db)
+ function __construct($db)
{
- $this->db =& $db;
+ $this->db =$db;
$this->tablename = $GLOBALS['tableprefix'] .'tags2tags';
}
$query.= " AND uId = '".intval($uId)."'";
}
//die($query);
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " LIMIT 0," . intval($limit);
}
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get linked tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " ORDER BY count DESC";
$query.= " LIMIT 0, " . intval($GLOBALS['maxSizeMenuBlock']);
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get linked tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= strlen($relationType)>0 ? ' AND relationType = \''. $this->db->sql_escape($relationType) . "'" : '';
$query.= strlen($uId)>0 ? ' AND uId = '. intval($uId) : '';
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not remove tag relation', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query = 'DELETE FROM '. $this->getTableName();
$query.= ' WHERE uId = '. intval($uId);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not remove tag relation', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " AND uId = " . intval($uId);
//die($query);
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> '>', 'uId'=> $uId);
$query = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values);
//die($query);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add tag cache inference', '', __LINE__, __FILE__, $query, $this->db);
return false;
$query.= ' AND relationType = ">"';
$query.= strlen($uId)>0 ? ' AND uId = ' . intval($uId) : '';
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not remove tag cache inference', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$values = array('tag1' => $tag1, 'tag2' => $tag2, 'relationType'=> '=', 'uId'=> $uId);
$query = 'INSERT INTO '. $this->getTableName() .' '. $this->db->sql_build_array('INSERT', $values);
//die($query);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add tag cache synonymy', '', __LINE__, __FILE__, $query, $this->db);
return false;
$query.= ' AND relationType = "="';
$query.= ' AND uId = ' . intval($uId);
- if (!($dbresult =& $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not remove tag cache inference', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " AND uId = " . intval($uId);
//die($query);
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " AND uId = " . intval($uId);
$query.= $tagExcepted!=''?" AND tag2!='" . $this->db->sql_escape($tagExcepted) . "'" : '';
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
function deleteByUser($uId) {
$query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete user tags cache', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- $dbresults =& $this->db->sql_query($query);
+ $dbresults = $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
$this->db->sql_freeresult($dbresults);
if($row['nb'] == null) {
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- $dbresults =& $this->db->sql_query($query);
+ $dbresults = $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
$this->db->sql_freeresult($dbresults);
if($row['depth'] == null) {
$query.= " AND relationType = '". $relationType ."'";
$query.= " AND uId = '".$uId."'";
- $dbresults =& $this->db->sql_query($query);
+ $dbresults = $this->db->sql_query($query);
$row = $this->db->sql_fetchrow($dbresults);
$this->db->sql_freeresult($dbresults);
if($row['nbupdate'] == null) {
//die($query);
- if (! ($dbresult =& $this->db->sql_query($query)) ){
+ if (! ($dbresult = $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not update stats', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
function deleteTagStatForUser($uId) {
$query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete tag stats', '', __LINE__,
__FILE__, $query, $this->db);
return false;
if($nb>0) {
$query .= ' LIMIT 0, '.$nb;
}
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(GENERAL_ERROR, 'Could not get user', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
- while ($row = & $this->db->sql_fetchrow($dbresult)) {
+ while ($row = $this->db->sql_fetchrow($dbresult)) {
$users[] = $row;
}
$this->db->sql_freeresult($dbresult);
$query .= ' LIMIT 0, ' . intval($nb);
}
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(
GENERAL_ERROR, 'Could not get user',
'', __LINE__, __FILE__, $query, $this->db
}
$users = array();
- while ($row = & $this->db->sql_fetchrow($dbresult)) {
+ while ($row = $this->db->sql_fetchrow($dbresult)) {
$users[] = new SemanticScuttle_Model_User(
$row[$this->getFieldName('primary')],
$row[$this->getFieldName('username')]
')) = \''.$this->db->sql_escape($cook[1]).'\' AND '.
$this->getFieldName('primary'). ' = '. $this->db->sql_escape($cook[0]);
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(
GENERAL_ERROR, 'Could not get user',
'', __LINE__, __FILE__, $query, $this->db
// Gets the list of user IDs being watched by the given user.
$query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($uId);
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(GENERAL_ERROR, 'Could not get watchlist', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
$this->db->sql_freeresult($dbresult);
return $arrWatch;
}
- while ($row =& $this->db->sql_fetchrow($dbresult)) {
+ while ($row = $this->db->sql_fetchrow($dbresult)) {
$arrWatch[] = $row['watched'];
}
$this->db->sql_freeresult($dbresult);
// Returns true if the current user is watching the given user, and false otherwise.
$query = 'SELECT watched FROM '. $GLOBALS['tableprefix'] .'watched AS W INNER JOIN '. $this->getTableName() .' AS U ON U.'. $this->getFieldName('primary') .' = W.watched WHERE U.'. $this->getFieldName('primary') .' = '. intval($watcheduser) .' AND W.uId = '. intval($currentuser);
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(GENERAL_ERROR, 'Could not get watchstatus', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
if ($watched) {
$sql = 'DELETE FROM '. $GLOBALS['tableprefix'] .'watched WHERE uId = '. intval($currentUserID) .' AND watched = '. intval($subjectUserID);
- if (!($dbresult =& $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db);
return false;
'watched' => intval($subjectUserID)
);
$sql = 'INSERT INTO '. $GLOBALS['tableprefix'] .'watched '. $this->db->sql_build_array('INSERT', $values);
- if (!($dbresult =& $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not add user to watch list', '', __LINE__, __FILE__, $sql, $this->db);
return false;
// Execute the statement.
$this->db->sql_transaction('begin');
- if (!($dbresult = & $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(
GENERAL_ERROR, 'Could not insert user',
// Execute the statement.
$this->db->sql_transaction('begin');
- if (!($dbresult = & $this->db->sql_query($sql))) {
+ if (!($dbresult = $this->db->sql_query($sql))) {
$this->db->sql_transaction('rollback');
message_die(
GENERAL_ERROR, 'Could not update user', '',
function getAllUsers ( ) {
$query = 'SELECT * FROM '. $this->getTableName();
- if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ if (! ($dbresult = $this->db->sql_query($query)) ) {
message_die(GENERAL_ERROR, 'Could not get users', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
function deleteUser($uId) {
$query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);
- if (!($dbresult = & $this->db->sql_query($query))) {
+ if (!($dbresult = $this->db->sql_query($query))) {
message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
echo "<html>\n<body>\n". $msg_title ."\n<br /><br />\n". $msg_text ."</body>\n</html>";
exit;
}
+
+/**
+ * Calls reset() on the given arg, without the E_STRICT error
+ * "Only variables should be passed by reference"
+ *
+ * @param array $arg Array to return first element of
+ *
+ * @return mixed First element of the array
+ */
+function rreset($array)
+{
+ return reset($array);
+}
?>
*/
public function testMimeTypeFilename()
{
- $res = reset($this->getAuthRequest())->send();
+ $res = rreset($this->getAuthRequest())->send();
$this->assertEquals(200, $res->getStatus());
//verify MIME content type
$ar[] = $arl;
}
}
- if (count(end($ar)) == 1 && reset(end($ar)) == '') {
+ if (count(end($ar)) == 1 && rreset(end($ar)) == '') {
unset($ar[key($ar)]);
}
return $ar;
$xhtml = $req->send()->getBody();
$xml = simplexml_load_string($xhtml);
- $xml->registerXPathNamespace('h', reset($xml->getDocNamespaces()));
+ $xml->registerXPathNamespace('h', rreset($xml->getDocNamespaces()));
$this->assertInstanceOf(
'SimpleXMLElement', $xml,
{
$xml = $this->getRequest('api/opensearch.php')->send()->getBody();
$x = simplexml_load_string($xml);
- $x->registerXPathNamespace('os', reset($x->getDocNamespaces()));
+ $x->registerXPathNamespace('os', rreset($x->getDocNamespaces()));
$arElements = $x->xpath('//os:Url[@type="text/html"]');
$this->assertEquals(
protected function addUser(
$username = null, $password = null, $privateKey = null
) {
- return reset($this->addUserData($username, $password, $privateKey));
+ return rreset($this->addUserData($username, $password, $privateKey));
}