mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix DOM warnings
This commit is contained in:
parent
2b133e9149
commit
d85ab21ac4
15 changed files with 89 additions and 80 deletions
|
@ -78,7 +78,7 @@ PHP_METHOD(domattr, __construct)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
nodep = xmlNewProp(NULL, (xmlChar *) name, value);
|
||||
nodep = xmlNewProp(NULL, (xmlChar *) name, (xmlChar *) value);
|
||||
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
|
@ -147,7 +147,7 @@ int dom_attr_value_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
}
|
||||
|
||||
if ((content = xmlNodeGetContent((xmlNodePtr) attrp)) != NULL) {
|
||||
ZVAL_STRING(retval, content);
|
||||
ZVAL_STRING(retval, (char *) content);
|
||||
xmlFree(content);
|
||||
} else {
|
||||
ZVAL_EMPTY_STRING(retval);
|
||||
|
@ -173,7 +173,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
|
|||
|
||||
str = zval_get_string(newval);
|
||||
|
||||
xmlNodeSetContentLen((xmlNodePtr) attrp, str->val, str->len + 1);
|
||||
xmlNodeSetContentLen((xmlNodePtr) attrp, (xmlChar *) str->val, str->len + 1);
|
||||
|
||||
zend_string_release(str);
|
||||
return SUCCESS;
|
||||
|
|
|
@ -87,7 +87,7 @@ int dom_characterdata_data_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
}
|
||||
|
||||
if ((content = xmlNodeGetContent(nodep)) != NULL) {
|
||||
ZVAL_STRING(retval, content);
|
||||
ZVAL_STRING(retval, (char *) content);
|
||||
xmlFree(content);
|
||||
} else {
|
||||
ZVAL_EMPTY_STRING(retval);
|
||||
|
@ -108,7 +108,7 @@ int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
|
|||
|
||||
str = zval_get_string(newval);
|
||||
|
||||
xmlNodeSetContentLen(nodep, str->val, str->len + 1);
|
||||
xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
|
||||
|
||||
zend_string_release(str);
|
||||
return SUCCESS;
|
||||
|
@ -187,7 +187,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
|
|||
xmlFree(cur);
|
||||
|
||||
if (substring) {
|
||||
RETVAL_STRING(substring);
|
||||
RETVAL_STRING((char *) substring);
|
||||
xmlFree(substring);
|
||||
} else {
|
||||
RETVAL_EMPTY_STRING();
|
||||
|
@ -223,7 +223,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
|
|||
}
|
||||
nodep->properties = NULL;
|
||||
#else
|
||||
xmlTextConcat(nodep, arg, arg_len);
|
||||
xmlTextConcat(nodep, (xmlChar *) arg, arg_len);
|
||||
#endif
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
|
|||
xmlFree(cur);
|
||||
|
||||
xmlNodeSetContent(node, first);
|
||||
xmlNodeAddContent(node, arg);
|
||||
xmlNodeAddContent(node, (xmlChar *) arg);
|
||||
xmlNodeAddContent(node, second);
|
||||
|
||||
xmlFree(first);
|
||||
|
@ -381,7 +381,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
|
|||
second = xmlUTF8Strsub(cur, offset + count, length - offset);
|
||||
}
|
||||
|
||||
substring = xmlStrcat(substring, arg);
|
||||
substring = xmlStrcat(substring, (xmlChar *) arg);
|
||||
substring = xmlStrcat(substring, second);
|
||||
|
||||
xmlNodeSetContent(node, substring);
|
||||
|
|
|
@ -712,7 +712,7 @@ PHP_FUNCTION(dom_document_create_element)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewDocNode(docp, NULL, name, value);
|
||||
node = xmlNewDocNode(docp, NULL, (xmlChar *) name, (xmlChar *) value);
|
||||
if (!node) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -931,7 +931,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewReference(docp, name);
|
||||
node = xmlNewReference(docp, (xmlChar *) name);
|
||||
if (!node) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
@ -1048,9 +1048,9 @@ PHP_FUNCTION(dom_document_create_element_ns)
|
|||
|
||||
if (errorcode == 0) {
|
||||
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
|
||||
nodep = xmlNewDocNode (docp, NULL, localname, value);
|
||||
nodep = xmlNewDocNode(docp, NULL, (xmlChar *) localname, (xmlChar *) value);
|
||||
if (nodep != NULL && uri != NULL) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
|
||||
nsptr = xmlSearchNsByHref(nodep->doc, nodep, (xmlChar *) uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
|
||||
}
|
||||
|
@ -1113,9 +1113,9 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
|
|||
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
|
||||
if (errorcode == 0) {
|
||||
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
|
||||
nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
|
||||
nodep = (xmlNodePtr) xmlNewDocProp(docp, (xmlChar *) localname, NULL);
|
||||
if (nodep != NULL && uri_len > 0) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
|
||||
nsptr = xmlSearchNsByHref(nodep->doc, root, (xmlChar *) uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
|
||||
}
|
||||
|
@ -1268,7 +1268,7 @@ PHP_METHOD(domdocument, __construct)
|
|||
}
|
||||
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
docp = xmlNewDoc(version);
|
||||
docp = xmlNewDoc((xmlChar *) version);
|
||||
|
||||
if (!docp) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
|
@ -1276,7 +1276,7 @@ PHP_METHOD(domdocument, __construct)
|
|||
}
|
||||
|
||||
if (encoding_len > 0) {
|
||||
docp->encoding = (const xmlChar*)xmlStrdup(encoding);
|
||||
docp->encoding = (const xmlChar *) xmlStrdup((xmlChar *) encoding);
|
||||
}
|
||||
|
||||
intern = Z_DOMOBJ_P(id);
|
||||
|
@ -1306,8 +1306,8 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
|
|||
int isFileUri = 0;
|
||||
|
||||
uri = xmlCreateURI();
|
||||
escsource = xmlURIEscapeStr(source, ":");
|
||||
xmlParseURIReference(uri, escsource);
|
||||
escsource = xmlURIEscapeStr((xmlChar *) source, (xmlChar *) ":");
|
||||
xmlParseURIReference(uri, (char *) escsource);
|
||||
xmlFree(escsource);
|
||||
|
||||
if (uri->scheme != NULL) {
|
||||
|
@ -1454,7 +1454,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
|
|||
}
|
||||
/* If loading from memory, set the base reference uri for the document */
|
||||
if (ret && ret->URL == NULL && ctxt->directory != NULL) {
|
||||
ret->URL = xmlStrdup(ctxt->directory);
|
||||
ret->URL = xmlStrdup((xmlChar *) ctxt->directory);
|
||||
}
|
||||
} else {
|
||||
ret = NULL;
|
||||
|
@ -1642,7 +1642,7 @@ PHP_FUNCTION(dom_document_savexml)
|
|||
xmlBufferFree(buf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETVAL_STRING(mem);
|
||||
RETVAL_STRING((char *) mem);
|
||||
xmlBufferFree(buf);
|
||||
} else {
|
||||
if (options & LIBXML_SAVE_NOEMPTYTAG) {
|
||||
|
@ -1657,7 +1657,7 @@ PHP_FUNCTION(dom_document_savexml)
|
|||
if (!size) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETVAL_STRINGL(mem, size);
|
||||
RETVAL_STRINGL((char *) mem, size);
|
||||
xmlFree(mem);
|
||||
}
|
||||
}
|
||||
|
@ -1995,7 +1995,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
|
|||
if (mode == DOM_LOAD_FILE) {
|
||||
ctxt = htmlCreateFileParserCtxt(source, NULL);
|
||||
} else {
|
||||
source_len = xmlStrlen(source);
|
||||
source_len = xmlStrlen((xmlChar *) source);
|
||||
ctxt = htmlCreateMemoryParserCtxt(source, source_len);
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ PHP_METHOD(domdocumentfragment, appendXML) {
|
|||
}
|
||||
|
||||
if (data) {
|
||||
err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, data, &lst);
|
||||
err = xmlParseBalancedChunkMemory(nodep->doc, NULL, NULL, 0, (xmlChar *) data, &lst);
|
||||
if (err != 0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
|
|
@ -218,7 +218,8 @@ static void php_dom_iterator_move_forward(zend_object_iterator *iter TSRMLS_DC)
|
|||
} else {
|
||||
goto err;
|
||||
}
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(basenode, objmap->ns, objmap->local, &previndex, iter->index);
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(
|
||||
basenode, (char *) objmap->ns, (char *) objmap->local, &previndex, iter->index);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -294,7 +295,8 @@ zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, i
|
|||
} else {
|
||||
nodep = nodep->children;
|
||||
}
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &curindex, 0);
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(
|
||||
nodep, (char *) objmap->ns, (char *) objmap->local, &curindex, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -107,14 +107,16 @@ PHP_METHOD(domimplementation, createDocumentType)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (publicid_len > 0)
|
||||
pch1 = publicid;
|
||||
if (systemid_len > 0)
|
||||
pch2 = systemid;
|
||||
if (publicid_len > 0) {
|
||||
pch1 = (xmlChar *) publicid;
|
||||
}
|
||||
if (systemid_len > 0) {
|
||||
pch2 = (xmlChar *) systemid;
|
||||
}
|
||||
|
||||
uri = xmlParseURI(name);
|
||||
if (uri != NULL && uri->opaque != NULL) {
|
||||
localname = xmlStrdup(uri->opaque);
|
||||
localname = xmlStrdup((xmlChar *) uri->opaque);
|
||||
if (xmlStrchr(localname, (xmlChar) ':') != NULL) {
|
||||
php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
|
||||
xmlFreeURI(uri);
|
||||
|
@ -122,7 +124,7 @@ PHP_METHOD(domimplementation, createDocumentType)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
localname = xmlStrdup(name);
|
||||
localname = xmlStrdup((xmlChar *) name);
|
||||
}
|
||||
|
||||
/* TODO: Test that localname has no invalid chars
|
||||
|
@ -182,7 +184,9 @@ PHP_METHOD(domimplementation, createDocument)
|
|||
|
||||
if (name_len > 0) {
|
||||
errorcode = dom_check_qname(name, &localname, &prefix, 1, name_len);
|
||||
if (errorcode == 0 && uri_len > 0 && ((nsptr = xmlNewNs(NULL, uri, prefix)) == NULL)) {
|
||||
if (errorcode == 0 && uri_len > 0
|
||||
&& ((nsptr = xmlNewNs(NULL, (xmlChar *) uri, (xmlChar *) prefix)) == NULL)
|
||||
) {
|
||||
errorcode = NAMESPACE_ERR;
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +221,7 @@ PHP_METHOD(domimplementation, createDocument)
|
|||
}
|
||||
|
||||
if (localname != NULL) {
|
||||
nodep = xmlNewDocNode (docp, nsptr, localname, NULL);
|
||||
nodep = xmlNewDocNode(docp, nsptr, (xmlChar *) localname, NULL);
|
||||
if (!nodep) {
|
||||
if (doctype != NULL) {
|
||||
docp->intSubset = NULL;
|
||||
|
|
|
@ -201,7 +201,7 @@ PHP_METHOD(domelement, __construct)
|
|||
}
|
||||
} else {
|
||||
/* If you don't pass a namespace uri, then you can't set a prefix */
|
||||
localname = xmlSplitQName2((xmlChar *)name, (xmlChar **) &prefix);
|
||||
localname = (char *) xmlSplitQName2((xmlChar *) name, (xmlChar **) &prefix);
|
||||
if (prefix != NULL) {
|
||||
xmlFree(localname);
|
||||
xmlFree(prefix);
|
||||
|
|
|
@ -107,7 +107,7 @@ int dom_entity_notation_name_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
|
||||
ZVAL_NULL(retval);
|
||||
} else {
|
||||
content = xmlNodeGetContent((xmlNodePtr) nodep);
|
||||
content = (char *) xmlNodeGetContent((xmlNodePtr) nodep);
|
||||
ZVAL_STRING(retval, content);
|
||||
xmlFree(content);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ PHP_METHOD(domentityreference, __construct)
|
|||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewReference(NULL, name);
|
||||
node = xmlNewReference(NULL, (xmlChar *) name);
|
||||
|
||||
if (!node) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
|
|
|
@ -149,9 +149,9 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
|
|||
objmap->nodetype == XML_ENTITY_NODE) {
|
||||
if (objmap->ht) {
|
||||
if (objmap->nodetype == XML_ENTITY_NODE) {
|
||||
itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named);
|
||||
itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, (xmlChar *) named);
|
||||
} else {
|
||||
notep = (xmlNotation *)xmlHashLookup(objmap->ht, named);
|
||||
notep = (xmlNotation *)xmlHashLookup(objmap->ht, (xmlChar *) named);
|
||||
if (notep) {
|
||||
itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
|
|||
} else {
|
||||
nodep = dom_object_get_node(objmap->baseobj);
|
||||
if (nodep) {
|
||||
itemnode = (xmlNodePtr)xmlHasProp(nodep, named);
|
||||
itemnode = (xmlNodePtr)xmlHasProp(nodep, (xmlChar *) named);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -282,9 +282,9 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
|
|||
objmap->nodetype == XML_ENTITY_NODE) {
|
||||
if (objmap->ht) {
|
||||
if (objmap->nodetype == XML_ENTITY_NODE) {
|
||||
itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, named);
|
||||
itemnode = (xmlNodePtr)xmlHashLookup(objmap->ht, (xmlChar *) named);
|
||||
} else {
|
||||
notep = (xmlNotation *)xmlHashLookup(objmap->ht, named);
|
||||
notep = (xmlNotation *)xmlHashLookup(objmap->ht, (xmlChar *) named);
|
||||
if (notep) {
|
||||
itemnode = create_notation(notep->name, notep->PublicID, notep->SystemID);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
|
|||
} else {
|
||||
nodep = dom_object_get_node(objmap->baseobj);
|
||||
if (nodep) {
|
||||
itemnode = (xmlNodePtr)xmlHasNsProp(nodep, named, uri);
|
||||
itemnode = (xmlNodePtr)xmlHasNsProp(nodep, (xmlChar *) named, (xmlChar *) uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -216,9 +216,9 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
ns = nodep->ns;
|
||||
if (ns != NULL && ns->prefix) {
|
||||
qname = xmlStrdup(ns->prefix);
|
||||
qname = xmlStrcat(qname, ":");
|
||||
qname = xmlStrcat(qname, (xmlChar *) ":");
|
||||
qname = xmlStrcat(qname, nodep->name);
|
||||
str = qname;
|
||||
str = (char *) qname;
|
||||
} else {
|
||||
str = (char *) nodep->name;
|
||||
}
|
||||
|
@ -226,10 +226,10 @@ int dom_node_node_name_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
case XML_NAMESPACE_DECL:
|
||||
ns = nodep->ns;
|
||||
if (ns != NULL && ns->prefix) {
|
||||
qname = xmlStrdup("xmlns");
|
||||
qname = xmlStrcat(qname, ":");
|
||||
qname = xmlStrdup((xmlChar *) "xmlns");
|
||||
qname = xmlStrcat(qname, (xmlChar *) ":");
|
||||
qname = xmlStrcat(qname, nodep->name);
|
||||
str = qname;
|
||||
str = (char *) qname;
|
||||
} else {
|
||||
str = (char *) nodep->name;
|
||||
}
|
||||
|
@ -301,10 +301,10 @@ int dom_node_node_value_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
case XML_COMMENT_NODE:
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
case XML_PI_NODE:
|
||||
str = xmlNodeGetContent(nodep);
|
||||
str = (char *) xmlNodeGetContent(nodep);
|
||||
break;
|
||||
case XML_NAMESPACE_DECL:
|
||||
str = xmlNodeGetContent(nodep->children);
|
||||
str = (char *) xmlNodeGetContent(nodep->children);
|
||||
break;
|
||||
default:
|
||||
str = NULL;
|
||||
|
@ -344,7 +344,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
|
|||
case XML_PI_NODE:
|
||||
{
|
||||
zend_string *str = zval_get_string(newval);
|
||||
xmlNodeSetContentLen(nodep, str->val, str->len + 1);
|
||||
xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
|
||||
zend_string_release(str);
|
||||
break;
|
||||
}
|
||||
|
@ -725,10 +725,10 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
|
|||
if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) {
|
||||
strURI = (char *) nodep->ns->href;
|
||||
if (strURI == NULL ||
|
||||
(!strcmp (prefix, "xml") && strcmp(strURI, XML_XML_NAMESPACE)) ||
|
||||
(!strcmp(prefix, "xml") && strcmp(strURI, (char *) XML_XML_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && !strcmp(prefix, "xmlns") &&
|
||||
strcmp (strURI, DOM_XMLNS_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && !strcmp (nodep->name, "xmlns"))) {
|
||||
strcmp(strURI, (char *) DOM_XMLNS_NAMESPACE)) ||
|
||||
(nodep->type == XML_ATTRIBUTE_NODE && !strcmp((char *) nodep->name, "xmlns"))) {
|
||||
ns = NULL;
|
||||
} else {
|
||||
curns = nsnode->nsDef;
|
||||
|
@ -831,7 +831,7 @@ int dom_node_text_content_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
return FAILURE;
|
||||
}
|
||||
|
||||
str = xmlNodeGetContent(nodep);
|
||||
str = (char *) xmlNodeGetContent(nodep);
|
||||
|
||||
if (str != NULL) {
|
||||
ZVAL_STRING(retval, str);
|
||||
|
@ -855,7 +855,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
|
|||
}
|
||||
|
||||
str = zval_get_string(newval);
|
||||
enc_str = xmlEncodeEntitiesReentrant(nodep->doc, str->val);
|
||||
enc_str = xmlEncodeEntitiesReentrant(nodep->doc, (xmlChar *) str->val);
|
||||
xmlNodeSetContent(nodep, enc_str);
|
||||
xmlFree(enc_str);
|
||||
zend_string_release(str);
|
||||
|
@ -1545,8 +1545,9 @@ PHP_FUNCTION(dom_node_lookup_prefix)
|
|||
lookupp = nodep->parent;
|
||||
}
|
||||
|
||||
if (lookupp != NULL && (nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, uri))) {
|
||||
if (nsptr->prefix != NULL) {
|
||||
if (lookupp != NULL) {
|
||||
nsptr = xmlSearchNsByHref(lookupp->doc, lookupp, (xmlChar *) uri);
|
||||
if (nsptr && nsptr->prefix != NULL) {
|
||||
RETURN_STRING((char *) nsptr->prefix);
|
||||
}
|
||||
}
|
||||
|
@ -1580,7 +1581,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
|
|||
|
||||
if (nodep && uri_len > 0) {
|
||||
nsptr = xmlSearchNs(nodep->doc, nodep, NULL);
|
||||
if (nsptr && xmlStrEqual(nsptr->href, uri)) {
|
||||
if (nsptr && xmlStrEqual(nsptr->href, (xmlChar *) uri)) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1599,8 +1600,8 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
|
|||
xmlNodePtr nodep;
|
||||
dom_object *intern;
|
||||
xmlNsPtr nsptr;
|
||||
size_t prefix_len = 0;
|
||||
char *prefix=NULL;
|
||||
size_t prefix_len;
|
||||
char *prefix;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!", &id, dom_node_class_entry, &prefix, &prefix_len) == FAILURE) {
|
||||
return;
|
||||
|
@ -1614,7 +1615,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
|
|||
}
|
||||
}
|
||||
|
||||
nsptr = xmlSearchNs(nodep->doc, nodep, prefix);
|
||||
nsptr = xmlSearchNs(nodep->doc, nodep, (xmlChar *) prefix);
|
||||
if (nsptr && nsptr->href != NULL) {
|
||||
RETURN_STRING((char *) nsptr->href);
|
||||
}
|
||||
|
@ -1707,7 +1708,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
|
|||
if (nodep->type != XML_DOCUMENT_NODE) {
|
||||
ctxp = xmlXPathNewContext(docp);
|
||||
ctxp->node = nodep;
|
||||
xpathobjp = xmlXPathEvalExpression("(.//. | .//@* | .//namespace::*)", ctxp);
|
||||
xpathobjp = xmlXPathEvalExpression((xmlChar *) "(.//. | .//@* | .//namespace::*)", ctxp);
|
||||
ctxp->node = NULL;
|
||||
if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
|
||||
nodeset = xpathobjp->nodesetval;
|
||||
|
@ -1745,13 +1746,13 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
|
|||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(tmp), prefix, tmpns) {
|
||||
if (Z_TYPE_P(tmpns) == IS_STRING) {
|
||||
if (prefix) {
|
||||
xmlXPathRegisterNs(ctxp, prefix->val, Z_STRVAL_P(tmpns));
|
||||
xmlXPathRegisterNs(ctxp, (xmlChar *) prefix->val, (xmlChar *) Z_STRVAL_P(tmpns));
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
||||
xpathobjp = xmlXPathEvalExpression(xquery, ctxp);
|
||||
xpathobjp = xmlXPathEvalExpression((xmlChar *) xquery, ctxp);
|
||||
ctxp->node = NULL;
|
||||
if (xpathobjp && xpathobjp->type == XPATH_NODESET) {
|
||||
nodeset = xpathobjp->nodesetval;
|
||||
|
@ -1774,7 +1775,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
|
|||
sizeof(xmlChar *), 0);
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
|
||||
if (Z_TYPE_P(tmpns) == IS_STRING) {
|
||||
inclusive_ns_prefixes[nscount++] = Z_STRVAL_P(tmpns);
|
||||
inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
inclusive_ns_prefixes[nscount] = NULL;
|
||||
|
@ -1864,7 +1865,7 @@ PHP_METHOD(domnode, getNodePath)
|
|||
|
||||
DOM_GET_THIS_OBJ(nodep, id, xmlNodePtr, intern);
|
||||
|
||||
value = xmlGetNodePath(nodep);
|
||||
value = (char *) xmlGetNodePath(nodep);
|
||||
if (value == NULL) {
|
||||
RETURN_NULL();
|
||||
} else {
|
||||
|
|
|
@ -84,7 +84,8 @@ int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
} else {
|
||||
nodep = nodep->children;
|
||||
}
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, -1);
|
||||
curnode = dom_get_elements_by_tag_name_ns_raw(
|
||||
nodep, (char *) objmap->ns, (char *) objmap->local, &count, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +153,8 @@ PHP_FUNCTION(dom_nodelist_item)
|
|||
} else {
|
||||
nodep = nodep->children;
|
||||
}
|
||||
itemnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, index);
|
||||
itemnode = dom_get_elements_by_tag_name_ns_raw(
|
||||
nodep, (char *) objmap->ns, (char *) objmap->local, &count, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ int dom_processinginstruction_data_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
}
|
||||
|
||||
if ((content = xmlNodeGetContent(nodep)) != NULL) {
|
||||
ZVAL_STRING(retval, content);
|
||||
ZVAL_STRING(retval, (char *) content);
|
||||
xmlFree(content);
|
||||
} else {
|
||||
ZVAL_EMPTY_STRING(retval);
|
||||
|
@ -148,7 +148,7 @@ int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC
|
|||
|
||||
str = zval_get_string(newval);
|
||||
|
||||
xmlNodeSetContentLen(nodep, str->val, str->len + 1);
|
||||
xmlNodeSetContentLen(nodep, (xmlChar *) str->val, str->len + 1);
|
||||
|
||||
zend_string_release(str);
|
||||
return SUCCESS;
|
||||
|
|
|
@ -126,7 +126,7 @@ int dom_text_whole_text_read(dom_object *obj, zval *retval TSRMLS_DC)
|
|||
}
|
||||
|
||||
if (wholetext != NULL) {
|
||||
ZVAL_STRING(retval, wholetext);
|
||||
ZVAL_STRING(retval, (char *) wholetext);
|
||||
xmlFree(wholetext);
|
||||
} else {
|
||||
ZVAL_EMPTY_STRING(retval);
|
||||
|
|
|
@ -186,7 +186,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
|
|||
}
|
||||
return;
|
||||
}
|
||||
ZVAL_STRING(&fci.function_name, obj->stringval);
|
||||
ZVAL_STRING(&fci.function_name, (char *) obj->stringval);
|
||||
xmlXPathFreeObject(obj);
|
||||
|
||||
fci.symbol_table = NULL;
|
||||
|
@ -222,7 +222,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
|
|||
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
|
||||
} else {
|
||||
zend_string *str = zval_get_string(&retval);
|
||||
valuePush(ctxt, xmlXPathNewString(str->val));
|
||||
valuePush(ctxt, xmlXPathNewString((xmlChar *) str->val));
|
||||
zend_string_release(str);
|
||||
}
|
||||
zval_ptr_dtor(&retval);
|
||||
|
@ -412,7 +412,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
|
|||
ctxp->namespaces = ns;
|
||||
ctxp->nsNr = nsnbr;
|
||||
|
||||
xpathobjp = xmlXPathEvalExpression(expr, ctxp);
|
||||
xpathobjp = xmlXPathEvalExpression((xmlChar *) expr, ctxp);
|
||||
ctxp->node = NULL;
|
||||
|
||||
if (ns != NULL) {
|
||||
|
@ -453,12 +453,12 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
|
|||
nsparent = node->_private;
|
||||
curns = xmlNewNs(NULL, node->name, NULL);
|
||||
if (node->children) {
|
||||
curns->prefix = xmlStrdup((char *) node->children);
|
||||
curns->prefix = xmlStrdup((xmlChar *) node->children);
|
||||
}
|
||||
if (node->children) {
|
||||
node = xmlNewDocNode(docp, NULL, (char *) node->children, node->name);
|
||||
node = xmlNewDocNode(docp, NULL, (xmlChar *) node->children, node->name);
|
||||
} else {
|
||||
node = xmlNewDocNode(docp, NULL, "xmlns", node->name);
|
||||
node = xmlNewDocNode(docp, NULL, (xmlChar *) "xmlns", node->name);
|
||||
}
|
||||
node->type = XML_NAMESPACE_DECL;
|
||||
node->parent = nsparent;
|
||||
|
@ -483,7 +483,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
|
|||
break;
|
||||
|
||||
case XPATH_STRING:
|
||||
RETVAL_STRING(xpathobjp->stringval);
|
||||
RETVAL_STRING((char *) xpathobjp->stringval);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue