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

Custom Delimiters Not Working After v3.1.24 #64

Closed
daemonraco opened this issue Jun 26, 2015 · 3 comments
Closed

Custom Delimiters Not Working After v3.1.24 #64

daemonraco opened this issue Jun 26, 2015 · 3 comments

Comments

@daemonraco
Copy link

Hi,
I'm using custom tags and they work unless I use version v3.1.24 o later. Basically, it ignores them.
This would be my settings:

<?php

. . .

$smarty->left_delimiter = '<%';
$smarty->right_delimiter = '%>';

. . .

I've tried the previous release v3.1.23 and has no problem. To be exact, this is the last commit hash that worked: b8eb878

I'll provide a way to test this later in the comments

@daemonraco
Copy link
Author

How to test it the way I'm using it (you need a *nix, php and git):

#!/bin/bash
#
# Parameters.

TESTDIR="tb_test_smarty";
TAG="${1-v3.1.23}";
#
# Removing old test.
clear;
if [ -e $TESTDIR ]; then
    rm -fr $TESTDIR;
fi;
#
# Cloning TooBasic.
git clone https://github.com/daemonraco/toobasic.git $TESTDIR --recursive;
cd $TESTDIR;
#
# Right branch.
git checkout dev;
#
# Downloading dependencies (Smarty latest version).
git submodule init;
git submodule update;
#
# Swiching Smarty to the requested tag/hash.
cd libraries/smarty.git;
git checkout $TAG;
#
# Testing.
cd ../..;
php shell.php sys controller create testctrl --forced;
testLine="$(cat site/controllers/testctrl.php | grep '\\TooBasic\\Controller')";

if [ -n "$(echo "$testLine"|grep '%')" ]; then
    echo -n "Wrong Compilation";
else
    echo -n "Success";
fi;
echo " (result: '$testLine')";

after runinng it prompts a message for error or success with a line that may have problems:

you can run this script either directly to get smarty at v3.1.23, or giving a tag/hash to test: this are some examples:

$ ./test_smarty.sh b8eb8784d45162dea2fd939ef585e787dcbb3a1f
$ ./test_smarty.sh v3.1.24

A wrong compilation may look like this:

$ ./test_smarty.sh v3.1.24
Cloning into 'tb_test_smarty'...
remote: Counting objects: 1871, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1871 (delta 0), reused 0 (delta 0), pack-reused 1865
Receiving objects: 100% (1871/1871), 788.11 KiB | 349.00 KiB/s, done.
Resolving deltas: 100% (1096/1096), done.
Checking connectivity... done.
Branch dev set up to track remote branch dev from origin.
Switched to a new branch 'dev'
Submodule 'libraries/smarty.git' (https://github.com/smarty-php/smarty.git) registered for path 'libraries/smarty.git'
Cloning into 'libraries/smarty.git'...
remote: Counting objects: 31379, done.
remote: Total 31379 (delta 0), reused 0 (delta 0), pack-reused 31379
Receiving objects: 100% (31379/31379), 10.07 MiB | 1.79 MiB/s, done.
Resolving deltas: 100% (24753/24753), done.
Checking connectivity... done.
Submodule path 'libraries/smarty.git': checked out 'd804454f21015df3c980db3962008b28147ed289'
Previous HEAD position was d804454... Fix spelling
HEAD is now at b58771e... Release 3.1.24
Creating controller 'testctrl':
        Creating controller file: Ok
                - '/tmp/tb_test_smarty/site/controllers/testctrl.php'

        Creating view file: Ok
                - '/tmp/tb_test_smarty/site/templates/action/testctrl.html'

Wrong Compilation (result: 'class <%$controller%> extends \TooBasic\Controller {')

uwetews added a commit that referenced this issue Jun 27, 2015
@uwetews
Copy link
Contributor

uwetews commented Jun 27, 2015

This problem was caused by a change in parsing order and a naming conflict between your Smarty tag '<%' and the PHP ASP tags.

The fix is now in dev-master.

@uwetews uwetews closed this as completed Jun 27, 2015
uwetews added a commit that referenced this issue Jun 27, 2015
@daemonraco
Copy link
Author

Thank you very much @uwetews, I've run my tests again and it works perfect.

think-mcunanan pushed a commit to think-mcunanan/smarty that referenced this issue Mar 22, 2023
…e-php5-to-php7

Redmine-#5313:[レスポンス改善] サーバーサイドをPHP5→PHP7にアップグレードする
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