Author: as Date: Mon Dec 10 15:52:28 2007 New Revision: 6954 Log: - Use preg_match instead of substr_compare with negative offset.
Modified: trunk/Feed/src/processors/atom.php Modified: trunk/Feed/src/processors/atom.php ============================================================================== --- trunk/Feed/src/processors/atom.php [iso-8859-1] (original) +++ trunk/Feed/src/processors/atom.php [iso-8859-1] Mon Dec 10 15:52:28 2007 @@ -573,8 +573,7 @@ break; default: - if ( substr_compare( $val, '+xml', -4, 4, true ) === 0 - || substr_compare( $val, '/xml', -4, 4, true ) === 0 ) + if ( preg_match( '@[+/]xml$@', $type ) !== 0 ) { // @todo: implement to assign the text in $dataNode as an XML node into $elementTag $this->addAttribute( $elementTag, 'type', $val ); @@ -829,8 +828,7 @@ $contentBase64 = true; if ( $contentPresent && is_object( $content ) && ( in_array( $content->type, array( 'text', 'html', 'xhtml', null ) ) - || substr_compare( $content->type, '+xml', -4, 4, true ) === 0 - || substr_compare( $content->type, '/xml', -4, 4, true ) === 0 + || preg_match( '@[+/[EMAIL PROTECTED]', $content->type ) !== 0 || substr_compare( $content->type, 'text/', 0, 5, true ) === 0 ) ) { $contentBase64 = false; @@ -1216,8 +1214,7 @@ break; default: - if ( substr_compare( $type, '+xml', -4, 4, true ) === 0 - || substr_compare( $type, '/xml', -4, 4, true ) === 0 ) + if ( preg_match( '@[+/[EMAIL PROTECTED]', $type ) !== 0 ) { foreach ( $itemChild->childNodes as $node ) { -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components