~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to ext/dom/document.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   +----------------------------------------------------------------------+
3
3
   | PHP Version 5                                                        |
4
4
   +----------------------------------------------------------------------+
5
 
   | Copyright (c) 1997-2009 The PHP Group                                |
 
5
   | Copyright (c) 1997-2010 The PHP Group                                |
6
6
   +----------------------------------------------------------------------+
7
7
   | This source file is subject to version 3.01 of the PHP license,      |
8
8
   | that is bundled with this package in the file LICENSE, and is        |
17
17
   +----------------------------------------------------------------------+
18
18
*/
19
19
 
20
 
/* $Id: document.c 282119 2009-06-14 13:13:35Z iliaa $ */
 
20
/* $Id: document.c 294436 2010-02-03 18:41:27Z pajoye $ */
21
21
 
22
22
#ifdef HAVE_CONFIG_H
23
23
#include "config.h"
1203
1203
                if (!retnodep) {
1204
1204
                        RETURN_FALSE;
1205
1205
                }
1206
 
                
 
1206
 
 
1207
                if ((retnodep->type == XML_ATTRIBUTE_NODE) && (nodep->ns != NULL)) {
 
1208
                        xmlNsPtr nsptr = NULL;
 
1209
                        xmlNodePtr root = xmlDocGetRootElement(docp);
 
1210
 
 
1211
                        nsptr = xmlSearchNsByHref (nodep->doc, root, nodep->ns->href);
 
1212
                        if (nsptr == NULL) {
 
1213
                                int errorcode;
 
1214
                                nsptr = dom_get_ns(root, nodep->ns->href, &errorcode, nodep->ns->prefix);
 
1215
                        }
 
1216
                        xmlSetNs(retnodep, nsptr);
 
1217
                }
1207
1218
        }
1208
1219
 
1209
1220
        DOM_RET_OBJ(rv, (xmlNodePtr) retnodep, &ret, intern);
1531
1542
}
1532
1543
/* }}} */
1533
1544
 
1534
 
static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int options TSRMLS_DC) /* {{{ */
 
1545
static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int source_len, int options TSRMLS_DC) /* {{{ */
1535
1546
{
1536
1547
    xmlDocPtr ret;
1537
1548
    xmlParserCtxtPtr ctxt = NULL;
1568
1579
                }
1569
1580
                
1570
1581
        } else {
1571
 
                ctxt = xmlCreateDocParserCtxt(source);
 
1582
                ctxt = xmlCreateMemoryParserCtxt(source, source_len);
1572
1583
        }
1573
1584
 
1574
1585
        if (ctxt == NULL) {
1671
1682
                RETURN_FALSE;
1672
1683
        }
1673
1684
 
1674
 
        newdoc = dom_document_parser(id, mode, source, options TSRMLS_CC);
 
1685
        newdoc = dom_document_parser(id, mode, source, source_len, options TSRMLS_CC);
1675
1686
 
1676
1687
        if (!newdoc)
1677
1688
                RETURN_FALSE;