Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10905 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26772 invoked by uid 1010); 5 Jul 2004 09:47:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26696 invoked from network); 5 Jul 2004 09:47:40 -0000 Received: from unknown (HELO sapo.pt) (212.55.154.21) by pb1.pair.com with SMTP; 5 Jul 2004 09:47:40 -0000 Received: (qmail 16913 invoked from network); 5 Jul 2004 09:47:38 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.153) by relay1 with SMTP; 5 Jul 2004 09:47:38 -0000 Received: (qmail 22957 invoked from network); 5 Jul 2004 09:44:02 -0000 Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[81.193.156.185]) (envelope-sender ) by mta3 (qmail-ldap-1.03) with SMTP for ; 5 Jul 2004 09:44:02 -0000 Message-ID: <006001c46275$1f248800$0100a8c0@pc07653> To: "PHPdev" Date: Mon, 5 Jul 2004 10:47:44 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_005D_01C4627D.8097E9D0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: [PATCH] tidylib behaviour changed From: nlopess@php.net ("Nuno Lopes") ------=_NextPart_000_005D_01C4627D.8097E9D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi, Finally today, the tidy team has corrected a bug in tidyLoadConfig. Attached is a patch that fixes PHP for the new behaviour (which is backward compatible with older libs) and I've also removed the repairString() and repairFile() methods (see why in my previous e-mail). Regards, Nuno -------------------------------------------------- Tidy bug: http://sourceforge.net/tracker/?func=detail&atid=390963&aid=937271&group_id=27659 Tidy response: "I have changed your patch, so that the tidyLoadConfig() return value is consistent with the existing usage of tidyLoadConfig() - e.g. in "tidy.c": -1 if the file is not found 0 if the file was parsed correctly 1 if there were errors parsing the file (unknown option, etc...) i.e. no change to the last line of the function." -------------------------------------------------- ------=_NextPart_000_005D_01C4627D.8097E9D0 Content-Type: text/plain; name="diff-tidy.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diff-tidy.txt" Index: tidy.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /repository/php-src/ext/tidy/tidy.c,v retrieving revision 1.55 diff -u -r1.55 tidy.c --- tidy.c 24 Jun 2004 14:20:59 -0000 1.55 +++ tidy.c 5 Jul 2004 09:41:31 -0000 @@ -86,9 +86,8 @@ } else { \ convert_to_string_ex(&_val); \ TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(_val)); \ - if (tidyLoadConfig(_doc, Z_STRVAL_P(_val)) < 0) { \ + if (tidyLoadConfig(_doc, Z_STRVAL_P(_val)) !=3D 0) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not = load configuration file '%s'", Z_STRVAL_P(_val)); \ - RETURN_FALSE; \ } \ } \ } @@ -250,8 +249,6 @@ TIDY_METHOD_MAP(cleanRepair, tidy_clean_repair, NULL) TIDY_DOC_ME(parseFile, NULL) TIDY_DOC_ME(parseString, NULL) - TIDY_METHOD_MAP(repairString, tidy_repair_string, NULL) - TIDY_METHOD_MAP(repairFile, tidy_repair_file, NULL) TIDY_METHOD_MAP(diagnose, tidy_diagnose, NULL) TIDY_METHOD_MAP(getRelease, tidy_get_release, NULL) TIDY_METHOD_MAP(getConfig, tidy_get_config, NULL) @@ -426,19 +423,7 @@ tidyOptSetBool(doc, TidyMark, no); =09 TIDY_SET_DEFAULT_CONFIG(doc); -=09 - /* We can't use TIDY_APPLY_CONFIG_ZVAL() here, it uses RETURN_FALSE */ - =20 - if(Z_TYPE_P(config) =3D=3D IS_ARRAY) { - _php_tidy_apply_config_array(doc, HASH_OF(config) TSRMLS_CC); - } else { - convert_to_string_ex(&config); - TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(config)); - if (tidyLoadConfig(doc, Z_STRVAL_P(config)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load = configuration file '%s'", Z_STRVAL_P(config)); - RETVAL_FALSE; - } - } + TIDY_APPLY_CONFIG_ZVAL(doc, config); =20 if(enc_len) { if (tidySetCharEncoding(doc, enc) < 0) { ------=_NextPart_000_005D_01C4627D.8097E9D0--