Commit Graph

62 Commits

Author SHA1 Message Date
Tugdual Saunier 40bba0e447 Fixed C extension sandbox behavior 2013-10-31 12:37:11 +01:00
Tugdual Saunier 7fb10c2dfa [ext] Fixed Windows compatibility (closes #1167) 2013-08-26 10:18:49 +02:00
Fabien Potencier 7b80c942e2 removed usage of deprecated constants 2013-08-05 18:25:53 +02:00
Fabien Potencier 07b86d2852 merged branch tucksaun/fix-issue-1143 (PR #1147)
This PR was merged into the master branch.

Discussion
----------

Fix issue #1143

Commits
-------

5042159 [ext] access static properties, fixed #1143
dfc335f Added test case for issue #1143
2013-08-04 14:54:06 +02:00
Tugdual Saunier 5042159ec4 [ext] access static properties, fixed #1143
Twig extension access static properties wheras it should not
2013-08-04 12:20:23 +02:00
Fabien Potencier 45d33e572f unified LICENSEs between the PHP and the C code 2013-08-03 19:12:32 +02:00
Tugdual Saunier 243043134c Fixed #1126 2013-07-23 21:36:14 +02:00
Fabien Potencier cbbbab9065 merged branch Tobion/patch-1 (PR #1030)
This PR was merged into the master branch.

Discussion
----------

fix numeric & boolean & float keys in array

Reopened PR of #878

Commits
-------

2c56b70 Merge pull request #3 from tucksaun/patch-1
17d6cc7 [ext] fixed tabs
46012ce [ext] improvements
21f8062 [ext] code cleaning
9347c52 [ext] updated PHP code documenting C code
b41ce60 updated C extension accordingly
e5291e1 rename item to attribute in the exception message because that's the term that is used in twig, e.g. the  function
a93f0dc further improved exception message and distinguish array_call and any_call access
26bac14 added tests for array access with confusable keys
db744d5 fix test that that would not fail if no exception is thrown
9ea16ec refactored getAttribute
6fb5afa improved error message for non-existent or invalid attributes
fdfd506 added changelog entry about fixed boolean array access
da616c5 fixed getAttribute for array access with a boolean or float key
b6acf9d updated CHANGELOG
c4d5b3f added some unit tests for previous merge
e84448b fix numeric keys in array
2013-05-07 20:56:07 +02:00
Tugdual Saunier 17d6cc7f10 [ext] fixed tabs 2013-04-08 17:20:46 +02:00
Tugdual Saunier 46012ce3b1 [ext] improvements 2013-04-08 17:20:42 +02:00
Tugdual Saunier 21f80622b6 [ext] code cleaning 2013-04-08 17:20:36 +02:00
Tugdual Saunier 9347c52b64 [ext] updated PHP code documenting C code 2013-04-08 17:20:09 +02:00
Tugdual Saunier 438338827b Revert "merged branch pierrejoye/master (PR #855)"
This reverts commit 347bc81d6e, reversing
changes made to 5d7baaf767.
2013-03-22 16:25:51 +01:00
Arjen Brouwer b41ce6094c updated C extension accordingly 2013-03-15 12:00:27 +01:00
Charles e8d12da98c Fix empty string comparison 2012-12-06 08:39:46 +07:00
Charles 55b76c1799 Fix extension crash when calling unknown method inside a macro 2012-11-08 09:25:27 +07:00
Charles 3164ee33d4 Fix build warning for const pointer 2012-11-07 08:49:50 +07:00
Charles db13b66774 Pass lineno and filename to Twig_Error constructor 2012-11-06 16:51:20 +07:00
Charles adb31d4012 Call Twig_Error constructor 2012-11-06 15:50:00 +07:00
Charles 1b82bf74fd Add template filename for the rest of the exception 2012-11-06 11:37:50 +07:00
Charles 5675140c9e Handle NULL filename 2012-11-06 11:16:51 +07:00
Charles 71f64bc83b Add template name to error message 2012-11-06 11:02:59 +07:00
Pierre Joye d398e557e3 - drop tsrm fetch, not necessary as it is passed as argument already 2012-10-08 15:15:38 +02:00
Anatoliy Belsky b013ede1fa fix windows build 2012-10-04 18:50:52 +02:00
Charles 9126dc649c Twig extension: fix case when accessing property of an array casted into object 2012-09-21 17:29:41 +07:00
Charles 34cf8e1c6e Fix double free 2012-09-21 16:42:13 +07:00
Charles 498090364b Enhancements for twig extension
- Fix extension memory leak
- Fix gcc compile warning (cast to const char *)
- Add TWIG_HAS_DYNAMIC_PROPERTY
- Remove the previous translation of 'array_key_exists($item, $object)'
  into TWIG_ARRAY_KEY_EXISTS when checking object property because what
  it really means is property_exists which has already been handled by
  TWIG_HAS_PROPERTY and TWIG_HAS_DYNAMIC_PROPERTY
- Fix native extension spacing
2012-09-21 14:47:45 +07:00
Charles 3485ee77ea Native extension: handle dynamic properties defined in the get_properties handler in a per instance fashion. 2012-09-20 18:29:21 +07:00
Fabien Potencier 11e91f63e9 merged branch arnaud-lb/792 (PR #814)
Commits
-------

8fa97bb php5.2 fix
d6fc86a [Tests] Test accessing a public property when \ArrayAccess is implemented
6704227 [ext] made ext consistent with 8ec73cf475
228d2b0 [ext] use only read_property handler

Discussion
----------

Alternative fix for 792

This fixes #792 as described in https://github.com/fabpot/Twig/issues/792#issuecomment-7482480

- 228d2b0 removes the *object-to-array convertion* trick, since the bug comes from there, and it doesn't appear to be needed
- 6704227 is the equivalent of aa6b835816 + 8ec73cf475 (this were not needed before because the bug was hidden by the object to array trick: numeric strings and integers are treated equally in arrays keys)

---------------------------------------------------------------------------

by stof at 2012-08-23T10:19:17Z

@arnaud-lb you need to fix the PHP 5.2 support
2012-08-23 14:18:58 +02:00
Arnaud Le Blanc 46ce33972f [ext] fixed php 5.2 ZTS builds
zend_hash_apply_with_arguments and its callback argument do not have a
TSRMLS in php 5.2.
2012-08-23 13:58:44 +02:00
Arnaud Le Blanc 8fa97bb526 php5.2 fix 2012-08-23 13:32:55 +02:00
Arnaud Le Blanc 6704227644 [ext] made ext consistent with 8ec73cf475 2012-08-23 11:54:31 +02:00
Arnaud Le Blanc 228d2b0351 [ext] use only read_property handler 2012-08-23 11:54:31 +02:00
Arnaud Le Blanc 3ca6654617 avoid crash when TWIG_GET_ARRAY_ELEMENT returns NULL
fixes #807
2012-08-20 20:28:22 +02:00
stealth35 9229ef334d Removed useless code 2012-06-27 17:57:06 +02:00
Fabien Potencier 4a0773a8ad fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension 2012-03-22 14:25:00 +01:00
Fabien Potencier 741b11c618 fixed Twig C extension 2012-02-28 23:19:54 +01:00
Sergey Linnik 75bfb4e1a0 Syncing Twig extension with latest changes in Twig master 2012-01-15 01:15:28 +04:00
Fabien Potencier c95fe91fc8 replaced zend_error_noreturn calls to zend_error as zend_error_noreturn is not exported (closes #554) 2011-12-22 14:17:59 +01:00
Arnaud Le Blanc b26d69af38 removed bogus TSRMLS_CCs 2011-12-21 19:52:05 +01:00
Fabien Potencier b990868012 merged branch arnaud-lb/ext-crash2 (PR #560)
Commits
-------

9e6f285 fixed crash in twig_template_get_attributes when input is not an array or object

Discussion
----------

Fix crash in twig_template_get_attributes when input is not an array or object

This fixes a crash when the input of twig_template_get_attributes() is not an array or object, and strict mode is enabled.

---------------------------------------------------------------------------

by nikic at 2011/12/16 12:03:21 -0800

Could you maybe place the exception tests in a different method?

---------------------------------------------------------------------------

by arnaud-lb at 2011/12/16 12:13:35 -0800

This method already expects many of its inputs to cause an exception to be thrown (it tests getAttribute() in strict mode, and in many cases the attribute isn't defined). I don't see a real benefit from moving these tests in a separate method in this case.
2011-12-17 08:58:24 +01:00
Arnaud Le Blanc 9e6f285362 fixed crash in twig_template_get_attributes when input is not an array or object 2011-12-16 20:46:37 +01:00
Fabien Potencier 972a93f85d merged branch arnaud-lb/ext-crash (PR #558)
Commits
-------

c920344 code style
50da1a2 don't modify function name

Discussion
----------

Fix crash in extension

This fixes a crash caused by `php_strtolower()` modifying its input. (Crashes on amd64, but not on x86 for me.)
2011-12-11 16:53:52 +01:00
Arnaud Le Blanc c9203442c5 code style 2011-12-10 14:49:52 +01:00
Arnaud Le Blanc 50da1a2881 don't modify function name 2011-12-10 14:48:20 +01:00
Fabien Potencier b496a2324c added Twig C extension version in phpinfo 2011-12-07 12:18:20 +01:00
Fabien Potencier 460ba4d6c7 bumped version to 1.5.0-DEV 2011-12-07 08:11:23 +01:00
Fabien Potencier 0b7d6dfa0c prepared the 1.4.0 release 2011-12-07 08:09:57 +01:00
Arnaud Le Blanc 569f782ad0 fix ZTS build 2011-11-23 14:01:51 +01:00
Arnaud Le Blanc 1606910a9a Fix undefined behavior
The callbacks are expected to return an integer, and returning void
instead was triggering weird bugs

I've also removed the casts to ensure that the signatures are compatible
2011-11-23 13:47:55 +01:00