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

Uncaught exception 'Exception' with fetch() #513

Closed
ghost opened this issue Nov 18, 2018 · 5 comments
Closed

Uncaught exception 'Exception' with fetch() #513

ghost opened this issue Nov 18, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 18, 2018

I am still using smarty 3.1.29 because every time I try to upgrade to 3.1.33 or the latest code in github, I receive the following error:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Unexpected input at line1: <' in /home/user/public_html/smarty/libs/sysplugins/smarty_internal_templatelexer.php:368

Stack trace:
#0 /home/user/public_html/smarty/libs/sysplugins/smarty_internal_templatelexer.php(279): Smarty_Internal_Templatelexer->yylex1()
#1 /home/user/public_html/smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php(123): Smarty_Internal_Templatelexer->yylex()
#2 /home/user/public_html/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(481): Smarty_Internal_SmartyTemplateCompiler->doCompile('{block name=con...', true)
#3 /home/user/public_html/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(405): Smarty_Internal_TemplateCompilerBase->compileTemplateSource(Object(Smarty_Internal_Template), NULL, NULL)
#4 /home/user/public_html/smarty/libs/sysplugins/smarty_template_compiled.php(184): Smarty_Internal_Templ in /home/user/public_html/smarty/libs/sysplugins/smarty_internal_templatelexer.php on line 368

Here is how I use fetch, which loads an html template with a block:

$smarty->fetch('extends:template.html|string:base64:'.$id)

I am not sure if its a bug in smarty or if something changed in the fetch command, but everything works fine in smarty 3.1.29.

@ghost ghost changed the title Exception with fetch() Uncaught exception 'Exception' with fetch() Nov 18, 2018
@juangacovas
Copy link

juangacovas commented Nov 18, 2018 via email

@ghost
Copy link
Author

ghost commented Nov 18, 2018

Unfortunately, upgrading is not an option. I'm using CentOS 7, which uses php 5.4, supported by RedHat (via RHEL) with regular patches and backports. Long-term support is for 10 years, so there is little change to upgrade to a newer version for various stability reasons.

I guess newer versions of smarty use some kind of feature that doesn't exist in php 5.4, I will try to compare the templatelexer.php file and see if I can figure out what is broken.

@ophian
Copy link

ophian commented Nov 19, 2018

Unfortunately, upgrading is not an option. I'm using CentOS 7, which uses php 5.4

Ridiculous! 😀 Sticking to 5.4 is not a good idea since it EOL support for security fixes was about mid 2015.
https://www.linuxtechi.com/install-php-7-centos-7-rhel-7-server/
http://php.net/supported-versions.php

@ghost
Copy link
Author

ghost commented Dec 22, 2018

Please read about LTS releases, they get 10 years of support and they are a very good idea to use as a stable and secure environment.

RHEL/CentOS have a fully updated and patched php 5.4 and will continue to do so for many many years.

@ophian
Copy link

ophian commented Dec 23, 2018

Normally package maintainers just patch what is found and patched in the origin, so if that stops it is normally dead.
Though I see that Remi (the Maintainer) did actively patch versions after official EOL. But - as you can see - he also compiles newer PHP versions for your system too and has himself stated that PHP 5.4 and 5.5 are EOL, so an upgrade is recommended.
https://rpms.remirepo.net/enterprise/7/

@ghost ghost closed this as completed Feb 12, 2020
This issue was closed.
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

No branches or pull requests

2 participants