Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call preg_match with '0' as flags-parameter #372

Closed
wants to merge 3 commits into from

Conversation

tomterl
Copy link

@tomterl tomterl commented Jun 9, 2017

hhvm croaks if preg_match is called with null as flags-parameter, because it expects a numerical value. Replacing null with 0 in the calls to preg_match that violate this expectation allows smarty to be used under hhvm; we have a mixed setup, running under php-fpm as well as under hhvm on the commandline for tools needing the extra performance and generally saner behaviour of hhvm.

Fatal error: Uncaught exception 'ErrorException' with message 'preg_match() expects parameter 4 to be integer, null given' in includes/libs/smarty/3.1.31/sysplugins/smarty_internal_templatelexer.php:310

I would be pleased if you would consider incorporating this small fix, or educate me if my fix is violating some standard or good-practice I am unaware of.

Many thanks for the great work on smarty -- it is much appreciated.

hhvm croaks if preg_match is called with `null` as flags-parameter, because it expects a numerical value. Replacing `null` with `0` in the calls to preg_match that violate this expectation allows smarty to be used under hhvm; we have a mixed setup, running under php-fpm as well as under hhvm on the commandline for tools needing the extra performance and generally saner behaviour of hhvm.

I would be pleased if you would consider incorporating this small fix, or educate me if my fix is violating some standard or good-practice I am unaware of.

Many thanks for the great work on smarty -- it is much appreciated.
@tomterl
Copy link
Author

tomterl commented Jun 9, 2017

The failing test is that hhvm is no longer supported on the chosen testing platform.

HHVM is no longer supported on Ubuntu Precise. Please consider using Trusty with `dist: trusty

tomterl added 2 commits June 15, 2017 12:42
hhvm tests don't run for smarty at the moment; switching to trusty might change that (it's suggested by the travis.ci test-report).
Out of the box, no test runs or works when simply using `dist: trusty`
uwetews added a commit to smarty-php/smarty-lexer that referenced this pull request Jul 21, 2017
@uwetews
Copy link
Contributor

uwetews commented Jul 21, 2017

Solved with commit 5a8d015

@uwetews uwetews closed this Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants