From dca9bd094a4231ba931abac2af33119f2079601d Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 27 Feb 2007 12:32:23 +0000 Subject: - function delete_user now clears asssociated data in the caddie table and the sessions table - xml writer improvement for web service git-svn-id: http://piwigo.org/svn/trunk@1863 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_protocols/rest_encoder.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/ws_protocols/rest_encoder.php b/include/ws_protocols/rest_encoder.php index c66cf2536..9352e5644 100644 --- a/include/ws_protocols/rest_encoder.php +++ b/include/ws_protocols/rest_encoder.php @@ -3,11 +3,10 @@ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ -// | branch : BSF (Best So Far) -// | file : $URL: svn+ssh://rvelices@svn.gna.org/svn/phpwebgallery/trunk/action.php $ -// | last update : $Date: 2006-12-21 18:49:12 -0500 (Thu, 21 Dec 2006) $ -// | last modifier : $Author: rvelices $ -// | revision : $Rev: 1678 $ +// | file : $Id$ +// | last update : $Date$ +// | last modifier : $Author$ +// | revision : $Revision$ // +-----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | @@ -84,15 +83,17 @@ class PwgXmlWriter { $this->_end_prev(false); $value = (string)$value; - $need_cdata = (strpos($value, "\r")!==false)?true:false; - if ($need_cdata) - { - $this->_output( '' ); - } - else - { - $this->_output( htmlspecialchars( $value ) ); - } + $this->_output( htmlspecialchars( $value ) ); + } + + function write_cdata($value) + { + $this->_end_prev(false); + $value = (string)$value; + $this->_output( + '', ']]>', $value) + . ']]>' ); } function write_attribute($name, $value) @@ -164,8 +165,6 @@ class PwgRestEncoder extends PwgResponseEncoder return $ret; } -//parent::flattenResponse($response); - $this->_writer = new PwgXmlWriter(); $this->encode($response); $ret = $this->_writer->getOutput(); -- cgit v1.2.3