Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51452 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19717 invoked from network); 16 Feb 2011 23:57:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Feb 2011 23:57:06 -0000 Authentication-Results: pb1.pair.com header.from=fxmulder@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=fxmulder@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: fxmulder@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:50714] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/F0-13417-2546C5D4 for ; Wed, 16 Feb 2011 18:57:06 -0500 Received: by iyb39 with SMTP id 39so1852254iyb.29 for ; Wed, 16 Feb 2011 15:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=LoZpS84aTeZFKBM6KACtvMFEgpBdC0L5X6jhFqYQdi8=; b=T6AuUqnTlS9c79prXBLhLZK/Etu1YHNs5g7MufCJqVbXv7gsKAFzcYhvwXXO7BJ0Od l37hmYa49xVeW+iu9HpP4I1mqfTD7JbxSecHMXj2xHz0yclFCkvY31kkW9QYtyM+C1we su9zsaAo6WjjDTUuxYeyJB9g1o0fUbGNFM/Iw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Rgp6mDWVix4LJGjuuOu5A3azHRD3GbhPlDLAPBPueSbmmk9Fwb7vP84zzodj+bE0dJ qDV3Pup9orxj+VdSvw7WUi52OODuK/cFWRosO70gO31noyvYddm+MiKxynJPMzf1CLmu 5hQOreMUqXcHOZABm8XRbxov8tsIwHjEWK22Q= MIME-Version: 1.0 Received: by 10.42.218.137 with SMTP id hq9mr1782461icb.481.1297900623776; Wed, 16 Feb 2011 15:57:03 -0800 (PST) Received: by 10.42.140.134 with HTTP; Wed, 16 Feb 2011 15:57:03 -0800 (PST) Date: Wed, 16 Feb 2011 16:57:03 -0700 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: PHP Patch for loadHTML options From: fxmulder@gmail.com (James Devine) I've included a patch for review adding the ability to optionally pass options to the DOMDocument::loadHTML[File] functions diff -ru php-5.3.5.orig/ext/dom/document.c php-5.3.5.new/ext/dom/document.c --- php-5.3.5.orig/ext/dom/document.c 2010-04-02 14:08:15.000000000 -0600 +++ php-5.3.5.new/ext/dom/document.c 2011-02-16 16:49:20.000000000 -0700 @@ -149,10 +149,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtml, 0, 0, 1) ZEND_ARG_INFO(0, source) + ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_loadhtmlfile, 0, 0, 1) ZEND_ARG_INFO(0, source) + ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_document_savehtml, 0, 0, 0) @@ -2157,10 +2159,11 @@ char *source; int source_len, refcount, ret; htmlParserCtxtPtr ctxt; + int options = 0; id = getThis(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &source_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &options) == FAILURE) { return; } @@ -2180,6 +2183,9 @@ RETURN_FALSE; } + if(options) + htmlCtxtUseOptions(ctxt, options); + ctxt->vctxt.error = php_libxml_ctx_error; ctxt->vctxt.warning = php_libxml_ctx_warning; if (ctxt->sax != NULL) {