Skip to content

Commit

Permalink
fixes rand()
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhelskiy committed Nov 15, 2016
1 parent 7c7cb46 commit f8f411f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/components/alert/alert.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{component_define_params params=[ 'title', 'text', 'visible', 'dismissible', 'close', 'mods', 'classes', 'attributes' ]}

{* Дефолтные значения *}
{$uid = "{$component}{rand( 0, 10e10 )}"}
{$uid = "{$component}{mt_rand()}"}
{$visible = $visible|default:true}

{$dismissible = ( $close ) ? $close : $dismissible}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/crop/crop.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<p class="{$component}-desc">{$desc}</p>
{/if}

<img src="{$image|escape}?v{rand( 0, 10e10 )}" width="{$width}" height="{$height}" class="{$component}-image js-crop" data-crop-width="{$originalWidth}" data-crop-height="{$originalHeight}">
<img src="{$image|escape}?v{mt_rand()}" width="{$width}" height="{$height}" class="{$component}-image js-crop" data-crop-width="{$originalWidth}" data-crop-height="{$originalHeight}">
{/capture}

{component 'modal'
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/editor/editor.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{$set = $set|default:'default'}

{* Уникальный ID *}
{$_uid = $id|default:($component|cat:rand(0, 10e10))}
{$_uid = $id|default:($component|cat:mt_rand())}

{* Уникальный ID окна загрузки файлов *}
{$_mediaUid = "media{$_uid}"}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/field/field.captcha-recaptcha.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{component_define_params params=[ 'id', 'captchaName', 'name', 'mods', 'attributes', 'classes' ]}

{$mods = "$mods recaptcha"}
{$uid = $id|default:($component|cat:rand(0, 10e10))}
{$uid = $id|default:($component|cat:mt_rand())}

<div class="{$component} {cmods name=$component mods=$mods} {$classes}" id="{$uid}" data-type="recaptcha" data-lsrecaptcha-captcha-name="{$captchaName}" data-lsrecaptcha-name="{$name}" {cattr list=$attributes}></div>
<a href="#" id="{$uid}-reset">Обновить каптчу</a><br/>
2 changes: 1 addition & 1 deletion frontend/components/field/field.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'rules', 'value', 'id', 'inputClasses', 'inputAttributes', 'inputData', 'mods', 'classes', 'attributes', 'note' ]}

{* Уникальный ID *}
{$uid = $id|default:($component|cat:rand(0, 10e10))}
{$uid = $id|default:($component|cat:mt_rand())}

{* Дефолтные значения *}
{$rules = $rules|default:[]}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/tabs/tabs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{* Уникальный ID для привязки таба к его содержимому *}
{foreach $tabs as $tab}
{$tabs[ $tab@index ][ 'uid' ] = "tab{rand( 0, 10e10 )}"}
{$tabs[ $tab@index ][ 'uid' ] = "tab{mt_rand()}"}
{/foreach}

<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
Expand Down

0 comments on commit f8f411f

Please sign in to comment.