S
S
smoky-jo2019-08-20 17:01:13
PHP
smoky-jo, 2019-08-20 17:01:13

Can't fix a bug in php or smarty?

Hello, the problem is this, there is such a template

<div class="property">
{capture name=surl assign=surl}{if $settings.enable_locations && in_array($v.depending.caption2, $location_fields)}javascript:;" onclick="changeLocation('{$live_site}', '{$v.depending.caption2}|{$t.name|rawurlencode}'){else}{if $seo_settings.enable_mod_rewrite}{if !isset($post_array[$v.depending.caption2])}{$constructed_url|replace:$sfield:$field_string}{else}{capture name=crt_field_string assign=crt_field_string}{$separator}{$v.depending.caption2}={if $post_array[$v.depending.caption2]|stristr:$t.name|rawurlencode}{$post_array[$v.depending.caption2]|lower|replace:{$t.name|lower}:''|trim:'|'}{else}{$t.name|lower|replace:'/':'_'|rawurlencode}|{$post_array[$v.depending.caption2]|lower}{/if}{/capture}{$constructed_url|replace:$sfield:$crt_field_string}{/if}{else}{if !isset($post_array[$v.depending.caption2])}{$constructed_url}{$separator}{$v.depending.caption2}={$t.name|replace:'/':'_'|rawurlencode}{else}{capture name=crt_field_string assign=crt_field_string}{if $post_array[$v.depending.caption2]|stristr:$t.name|rawurlencode}{$post_array[$v.depending.caption2]|lower|replace:{$t.name|lower}:''|trim:'|'}{else}{$t.name|lower|replace:'/':'_'|rawurlencode}|{$post_array[$v.depending.caption2]|lower}{/if}{/capture}{$constructed_url}{$separator}{$v.depending.caption2}={$crt_field_string}{/if}{/if}{/if}{/capture}
<a href="{$surl}" title="Выбрать этот параметр">{$t.name}{if $t.count>0}&nbsp;({$t.count}){/if}</a>{if $v.depending.no==2 && (!$settings.enable_locations || !in_array($v.depending.caption2, $location_fields))}&nbsp;
<label style="float: right;" class="enh_checkbox chk_container">
<input type="checkbox" name="{$v.depending.caption2}_{$t.name|rawurlencode}" {if stristr($post_array[$v.depending.caption2], $t.name)}checked{/if} onclick="window.location='{$surl}'" /><div class="chk_indicator"></div></label>{/if}&nbsp;
</div>

it displays a link to select a checkbox (you can select multiple) the selected ones are marked with a checkmark.
But the problem is that if the value in the database is in Russian or the first capital letter is indicated, then this template does not work, the items marked with a checkmark are not saved, but are only written to the address bar and the page is updated, and accordingly, if you uncheck the page, the page reloads and the parameter from the address bar does not disappear.
But if you make a parameter in the database with a small letter or in English (it doesn’t matter with a small or capital letter), then everything immediately starts working.
That is, the problem persists only in Russian and if the first letter is large.
Tried |lower in the template, it doesn't work.
$t.namethis is the value that is output to the template
Can this be fixed at the template level?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question