php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49428 cannot use array returned by tidy_get_config()
Submitted: 2009-09-01 07:12 UTC Modified: 2009-09-01 14:36 UTC
From: patrickallaert@php.net Assigned: patrickallaert (profile)
Status: Closed Package: Tidy (PECL)
PHP Version: 6SVN-2009-09-01 (SVN) OS: Linux
Private report: No CVE-ID: None
 [2009-09-01 07:12 UTC] patrickallaert@php.net
Description:
------------
This bug is perfectly similar to #47966 and can be reproduced with ext/tidy/tests/030.phpt.

I can't fix it missing karma. The patch is at:
http://pallaert.pastebin.com/f27da6f66

Reproduce code:
---------------
<?php
$buffer = '<html></html>';
$config = array(
  'indent' => true, // AutoBool
  'indent-attributes' => true, // Boolean
  'indent-spaces' => 3, // Integer
  'language' => 'de'); // String
$tidy = new tidy();
$tidy->parseString($buffer, $config);
$c = $tidy->getConfig();
var_dump($c['indent']);
var_dump($c['indent-attributes']);
var_dump($c['indent-spaces']);
var_dump($c['language']);
?>


Expected result:
----------------
int(1)
bool(true)
int(3)
%s(2) "de"


Actual result:
--------------
Notice: Undefined index: indent in ext/tidy/tests/030.php on line 11
NULL

Notice: Undefined index: indent-attributes in ext/tidy/tests/030.php on line 12
NULL

Notice: Undefined index: indent-spaces in ext/tidy/tests/030.php on line 13
NULL

Notice: Undefined index: language in ext/tidy/tests/030.php on line 14
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-01 14:02 UTC] kalle@php.net
Applied the patch for you Patrick
 [2009-09-01 14:05 UTC] svn@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=287943
Log: Fixes #49428 - Patch by Patrick Allaert
 [2009-09-01 14:36 UTC] patrickallaert@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thank you Kalle!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 23:01:29 2024 UTC