Correct allprop/include processing.

This commit is contained in:
Andrew McMillan 2010-02-28 22:39:02 +13:00
parent d763312279
commit 0e1df68878
4 changed files with 15 additions and 14 deletions

View File

@ -955,13 +955,15 @@ EOQRY;
*/
function DAV_AllProperties() {
if ( isset($this->dead_properties) ) $this->FetchDeadProperties();
$allprop = array_merge( (isset($this->dead_properties)?$this->dead_properties:array()), array(
'DAV::getcontenttype', 'DAV::resourcetype', 'DAV::getcontentlength', 'DAV::displayname', 'DAV::getlastmodified',
'DAV::creationdate', 'DAV::getetag', 'DAV::getcontentlanguage', 'DAV::supportedlock', 'DAV::lockdiscovery',
'DAV::owner', 'DAV::principal-URL', 'DAV::current-user-principal',
'urn:ietf:params:xml:ns:carddav:max-resource-size', 'urn:ietf:params:xml:ns:carddav:supported-address-data',
'urn:ietf:params:xml:ns:carddav:addressbook-description', 'urn:ietf:params:xml:ns:carddav:addressbook-home-set'
) );
$allprop = array_merge( (isset($this->dead_properties)?$this->dead_properties:array()),
(isset($include_properties)?$include_properties:array()),
array(
'DAV::getcontenttype', 'DAV::resourcetype', 'DAV::getcontentlength', 'DAV::displayname', 'DAV::getlastmodified',
'DAV::creationdate', 'DAV::getetag', 'DAV::getcontentlanguage', 'DAV::supportedlock', 'DAV::lockdiscovery',
'DAV::owner', 'DAV::principal-URL', 'DAV::current-user-principal',
'urn:ietf:params:xml:ns:carddav:max-resource-size', 'urn:ietf:params:xml:ns:carddav:supported-address-data',
'urn:ietf:params:xml:ns:carddav:addressbook-description', 'urn:ietf:params:xml:ns:carddav:addressbook-home-set'
) );
return $allprop;
}

View File

@ -10,7 +10,7 @@
$c = (object) array();
// Ditto for a few other global things
unset($session); unset($request); unset($dbconn); unset($_awl_dbconn);
unset($session); unset($request); unset($dbconn); unset($_awl_dbconn); unset($include_properties);
// An ultra-simple exception handler to catch errors that occur
// before we get a more functional exception handler in place...
@ -148,7 +148,7 @@ $_SERVER['SERVER_NAME'] = $c->domain_name;
require_once('PgQuery.php');
$c->want_dbversion = array(1,2,7);
$c->want_dbversion = array(1,2,8);
$c->schema_version = 0;
$qry = new PgQuery( 'SELECT schema_major, schema_minor, schema_patch FROM awl_db_revision ORDER BY schema_id DESC LIMIT 1;' );
if ( $qry->Exec('always') && $row = $qry->Fetch() ) {

View File

@ -10,7 +10,7 @@
$c = (object) array();
// Ditto for a few other global things
unset($session); unset($request); unset($dbconn); unset($_awl_dbconn);
unset($session); unset($request); unset($dbconn); unset($_awl_dbconn); unset($include_properties);
// An ultra-simple exception handler to catch errors that occur
// before we get a more functional exception handler in place...

View File

@ -6,7 +6,7 @@ function check_for_expansion( $calendar_data_node ) {
if ( !class_exists('DateTime') ) return; /** We don't support expansion on PHP5.1 */
$expansion = $v->GetElements('urn:ietf:params:xml:ns:caldav:expand');
$expansion = $calendar_data_node->GetElements('urn:ietf:params:xml:ns:caldav:expand');
if ( isset($expansion[0]) ) {
$need_expansion = true;
$expand_range_start = $expansion[0]->GetAttribute('start');
@ -28,7 +28,7 @@ switch( $proptype ) {
foreach( $qry_content[0]->GetElements() AS $k => $v ) {
$propertyname = preg_replace( '/^.*:/', '', $v->GetTag() );
$properties[$propertyname] = 1;
if ( $v->GetTag() == 'calendar-data' ) check_for_expansion($v);
if ( $v->GetTag() == 'urn:ietf:params:xml:ns:caldav:calendar-data' ) check_for_expansion($v);
}
break;
@ -36,8 +36,7 @@ switch( $proptype ) {
$properties['allprop'] = 1;
if ( $qry_content[1]->GetTag() == 'DAV::include' ) {
foreach( $qry_content[1]->GetElements() AS $k => $v ) {
$propertyname = preg_replace( '/^.*:/', '', $v->GetTag() );
$properties[$propertyname] = 1;
$include_properties[] = $v->GetTag(); /** $include_properties is referenced in DAVResource where allprop is expanded */
if ( $v->GetTag() == 'urn:ietf:params:xml:ns:caldav:calendar-data' ) check_for_expansion($v);
}
}