Test Failed
Pull Request — master (#592)
by Lucio
10:17
created
htdocs/class/xoopseditor/tinymce/formtinymce.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $this->configs['area_height'] = isset($this->configs['height']) ? $this->configs['height'] : $this->height;
55 55
         $this->configs['fonts']       = $this->getFonts();
56 56
 
57
-        require_once __DIR__ . '/tinymce.php';
57
+        require_once __DIR__.'/tinymce.php';
58 58
         $this->editor = new TinyMCE($this->configs);
59 59
     }
60 60
 
@@ -137,6 +137,6 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function isActive()
139 139
     {
140
-        return is_readable(XOOPS_ROOT_PATH . $this->rootPath . '/tinymce.php');
140
+        return is_readable(XOOPS_ROOT_PATH.$this->rootPath.'/tinymce.php');
141 141
     }
142 142
 }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce/settings.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
     'theme_advanced_resizing' => true,
52 52
     // load plugins
53 53
     'plugins' => 'xoopsimagemanager,xoopsquote,xoopscode,xoopsemotions,xoopsmlcontent,' . // Xoops plugins
54
-                 //"safari,autoresize,xhtmlxtras,directionality," . // plugins added from TinyMCE 3.2.5
55
-                 'safari,xhtmlxtras,directionality,' . // fixed from TinyMCE 3.3.6
56
-                 'advlist,style,xhtmlxtras,searchreplace,' . // plugins added from TinyMCE 3.3.6
57
-                 'table,advimage,advlink,emotions,insertdatetime,preview,media,contextmenu,' . 'paste,fullscreen,visualchars,nonbreaking,inlinepopups',
54
+                    //"safari,autoresize,xhtmlxtras,directionality," . // plugins added from TinyMCE 3.2.5
55
+                    'safari,xhtmlxtras,directionality,' . // fixed from TinyMCE 3.3.6
56
+                    'advlist,style,xhtmlxtras,searchreplace,' . // plugins added from TinyMCE 3.3.6
57
+                    'table,advimage,advlink,emotions,insertdatetime,preview,media,contextmenu,' . 'paste,fullscreen,visualchars,nonbreaking,inlinepopups',
58 58
     //"pagebreak,spellchecker,layer,save,advhr,iespell,inlinepopups," .
59 59
     //"print,directionality,noneditable,template,"
60 60
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
     'theme_advanced_resize_horizontal' => false,
51 51
     'theme_advanced_resizing' => true,
52 52
     // load plugins
53
-    'plugins' => 'xoopsimagemanager,xoopsquote,xoopscode,xoopsemotions,xoopsmlcontent,' . // Xoops plugins
53
+    'plugins' => 'xoopsimagemanager,xoopsquote,xoopscode,xoopsemotions,xoopsmlcontent,'.// Xoops plugins
54 54
                  //"safari,autoresize,xhtmlxtras,directionality," . // plugins added from TinyMCE 3.2.5
55
-                 'safari,xhtmlxtras,directionality,' . // fixed from TinyMCE 3.3.6
56
-                 'advlist,style,xhtmlxtras,searchreplace,' . // plugins added from TinyMCE 3.3.6
57
-                 'table,advimage,advlink,emotions,insertdatetime,preview,media,contextmenu,' . 'paste,fullscreen,visualchars,nonbreaking,inlinepopups',
55
+                 'safari,xhtmlxtras,directionality,'.// fixed from TinyMCE 3.3.6
56
+                 'advlist,style,xhtmlxtras,searchreplace,'.// plugins added from TinyMCE 3.3.6
57
+                 'table,advimage,advlink,emotions,insertdatetime,preview,media,contextmenu,'.'paste,fullscreen,visualchars,nonbreaking,inlinepopups',
58 58
     //"pagebreak,spellchecker,layer,save,advhr,iespell,inlinepopups," .
59 59
     //"print,directionality,noneditable,template,"
60 60
 
@@ -69,6 +69,6 @@  discard block
 block discarded – undo
69 69
     'theme_advanced_buttons3' => 'search,replace,|,tablecontrols,|,cleanup,visualaid,visualchars,|,insertdate,inserttime,|,preview,fullscreen,help,code',
70 70
     'theme_advanced_buttons4' => 'xoopsimagemanager,xoopsemotions,xoopsquote,xoopscode,xoopsmlcontent',
71 71
     // Full XHTML rule set
72
-    'valid_elements' => '' . 'a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name' . '|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev' . '|shape<circle?default?poly?rect|style|tabindex|title|target|type],' . 'abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase' . '|height|hspace|id|name|object|style|title|vspace|width],' . 'area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref' . '|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup' . '|shape<circle?default?poly?rect|style|tabindex|title|target],' . 'base[href|target],' . 'basefont[color|face|id|size],' . 'bdo[class|dir<ltr?rtl|id|lang|style|title],' . 'big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'blockquote[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick' . '|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' . '|onmouseover|onmouseup|style|title],' . 'body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink],' . 'br[class|clear<all?left?none?right|id|style|title],' . 'button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur' . '|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type' . '|value],' . 'caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' . '|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title' . '|valign<baseline?bottom?middle?top|width],' . 'colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl' . '|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title' . '|valign<baseline?bottom?middle?top|width],' . 'dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],' . 'del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],' . 'em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'font[class|color|dir<ltr?rtl|face|id|lang|size|style|title],' . 'form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang' . '|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit' . '|style|title|target],' . 'frame[class|frameborder|id|longdesc|marginheight|marginwidth|name' . '|noresize<noresize|scrolling<auto?no?yes|src|style|title],' . 'frameset[class|cols|id|onload|onunload|rows|style|title],' . 'h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'head[dir<ltr?rtl|lang|profile],' . 'hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|size|style|title|width],' . 'html[dir<ltr?rtl|lang|version],' . 'iframe[align<bottom?left?middle?right?top|class|frameborder|height|id' . '|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style' . '|title|width],' . 'img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height' . '|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|src|style|title|usemap|vspace|width],' . 'input[accept|accesskey|align<bottom?left?middle?right?top|alt' . '|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang' . '|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect' . '|readonly<readonly|size|src|style|tabindex|title' . '|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text' . '|usemap|value],' . 'ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'isindex[class|dir<ltr?rtl|id|lang|prompt|style|title],' . 'kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick' . '|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' . '|onmouseover|onmouseup|style|title],' . 'legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang' . '|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type' . '|value],' . 'link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type],' . 'map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme],' . 'noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'noscript[class|dir<ltr?rtl|id|lang|style|title],' . 'object[align<bottom?left?middle?right?top|archive|border|class|classid' . '|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name' . '|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap' . '|vspace|width],' . 'ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|start|style|title|type],' . 'optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick' . '|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' . '|onmouseover|onmouseup|selected<selected|style|title|value],' . 'p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|style|title],' . 'param[id|name|type|value|valuetype<DATA?OBJECT?REF],' . 'pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick' . '|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout' . '|onmouseover|onmouseup|style|title|width],' . 'q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 's[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],' . 'samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'script[charset|defer|language|src|type],' . 'select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name' . '|onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style' . '|tabindex|title],' . 'small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title],' . 'strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'style[dir<ltr?rtl|lang|media|title|type],' . 'sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title],' . 'table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class' . '|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules' . '|style|summary|title|width],' . 'tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id' . '|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|style|title' . '|valign<baseline?bottom?middle?top],' . 'td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class' . '|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup' . '|style|title|valign<baseline?bottom?middle?top|width],' . 'textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name' . '|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect' . '|readonly<readonly|rows|style|tabindex|title],' . 'tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' . '|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|style|title' . '|valign<baseline?bottom?middle?top],' . 'th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class' . '|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick' . '|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove' . '|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup' . '|style|title|valign<baseline?bottom?middle?top|width],' . 'thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id' . '|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown' . '|onmousemove|onmouseout|onmouseover|onmouseup|style|title' . '|valign<baseline?bottom?middle?top],' . 'title[dir<ltr?rtl|lang],' . 'tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class' . '|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title|valign<baseline?bottom?middle?top],' . 'tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],' . 'u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup' . '|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],' . 'ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown' . '|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover' . '|onmouseup|style|title|type],' . 'var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress' . '|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style' . '|title]'
72
+    'valid_elements' => ''.'a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name'.'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev'.'|shape<circle?default?poly?rect|style|tabindex|title|target|type],'.'abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase'.'|height|hspace|id|name|object|style|title|vspace|width],'.'area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref'.'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup'.'|shape<circle?default?poly?rect|style|tabindex|title|target],'.'base[href|target],'.'basefont[color|face|id|size],'.'bdo[class|dir<ltr?rtl|id|lang|style|title],'.'big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'blockquote[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick'.'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout'.'|onmouseover|onmouseup|style|title],'.'body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink],'.'br[class|clear<all?left?none?right|id|style|title],'.'button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur'.'|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type'.'|value],'.'caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id'.'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title'.'|valign<baseline?bottom?middle?top|width],'.'colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl'.'|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title'.'|valign<baseline?bottom?middle?top|width],'.'dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],'.'del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],'.'em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'font[class|color|dir<ltr?rtl|face|id|lang|size|style|title],'.'form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang'.'|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit'.'|style|title|target],'.'frame[class|frameborder|id|longdesc|marginheight|marginwidth|name'.'|noresize<noresize|scrolling<auto?no?yes|src|style|title],'.'frameset[class|cols|id|onload|onunload|rows|style|title],'.'h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'head[dir<ltr?rtl|lang|profile],'.'hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|size|style|title|width],'.'html[dir<ltr?rtl|lang|version],'.'iframe[align<bottom?left?middle?right?top|class|frameborder|height|id'.'|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style'.'|title|width],'.'img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height'.'|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|src|style|title|usemap|vspace|width],'.'input[accept|accesskey|align<bottom?left?middle?right?top|alt'.'|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang'.'|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect'.'|readonly<readonly|size|src|style|tabindex|title'.'|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text'.'|usemap|value],'.'ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'isindex[class|dir<ltr?rtl|id|lang|prompt|style|title],'.'kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick'.'|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout'.'|onmouseover|onmouseup|style|title],'.'legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang'.'|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type'.'|value],'.'link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type],'.'map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme],'.'noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'noscript[class|dir<ltr?rtl|id|lang|style|title],'.'object[align<bottom?left?middle?right?top|archive|border|class|classid'.'|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name'.'|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap'.'|vspace|width],'.'ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|start|style|title|type],'.'optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick'.'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout'.'|onmouseover|onmouseup|selected<selected|style|title|value],'.'p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|style|title],'.'param[id|name|type|value|valuetype<DATA?OBJECT?REF],'.'pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick'.'|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout'.'|onmouseover|onmouseup|style|title|width],'.'q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],'.'samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'script[charset|defer|language|src|type],'.'select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name'.'|onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style'.'|tabindex|title],'.'small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title],'.'strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'style[dir<ltr?rtl|lang|media|title|type],'.'sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title],'.'table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class'.'|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules'.'|style|summary|title|width],'.'tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id'.'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|style|title'.'|valign<baseline?bottom?middle?top],'.'td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class'.'|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup'.'|style|title|valign<baseline?bottom?middle?top|width],'.'textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name'.'|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect'.'|readonly<readonly|rows|style|tabindex|title],'.'tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id'.'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|style|title'.'|valign<baseline?bottom?middle?top],'.'th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class'.'|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick'.'|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove'.'|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup'.'|style|title|valign<baseline?bottom?middle?top|width],'.'thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id'.'|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown'.'|onmousemove|onmouseout|onmouseover|onmouseup|style|title'.'|valign<baseline?bottom?middle?top],'.'title[dir<ltr?rtl|lang],'.'tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class'.'|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title|valign<baseline?bottom?middle?top],'.'tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],'.'u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup'.'|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title],'.'ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown'.'|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover'.'|onmouseup|style|title|type],'.'var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress'.'|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style'.'|title]'
73 73
 
74 74
 );
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/textarea/editor_registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  */
18 18
 return $config = array(
19 19
     'class' => 'FormTextArea',
20
-    'file' => XOOPS_ROOT_PATH . '/class/xoopseditor/textarea/textarea.php',
20
+    'file' => XOOPS_ROOT_PATH.'/class/xoopseditor/textarea/textarea.php',
21 21
     'title' => _XOOPS_EDITOR_TEXTAREA, // display to end user
22 22
     'order' => 1, // 0 will disable the editor
23 23
     'nohtml' => 1 // For forms that have "dohtml" disabled
Please login to merge, or discard this patch.
htdocs/class/template.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,12 +60,12 @@
 block discarded – undo
60 60
         parent::__construct();
61 61
         $this->setCompileId();
62 62
         $this->assign(array(
63
-                          'xoops_url'        => XOOPS_URL,
64
-                          'xoops_rootpath'   => XOOPS_ROOT_PATH,
65
-                          'xoops_langcode'   => _LANGCODE,
66
-                          'xoops_charset'    => _CHARSET,
67
-                          'xoops_version'    => XOOPS_VERSION,
68
-                          'xoops_upload_url' => XOOPS_UPLOAD_URL));
63
+                            'xoops_url'        => XOOPS_URL,
64
+                            'xoops_rootpath'   => XOOPS_ROOT_PATH,
65
+                            'xoops_langcode'   => _LANGCODE,
66
+                            'xoops_charset'    => _CHARSET,
67
+                            'xoops_version'    => XOOPS_VERSION,
68
+                            'xoops_upload_url' => XOOPS_UPLOAD_URL));
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Base class: Smarty template engine
24 24
  */
25
-define('SMARTY_DIR', XOOPS_ROOT_PATH . '/class/smarty/');
26
-require_once SMARTY_DIR . 'Smarty.class.php';
25
+define('SMARTY_DIR', XOOPS_ROOT_PATH.'/class/smarty/');
26
+require_once SMARTY_DIR.'Smarty.class.php';
27 27
 
28 28
 /**
29 29
  * Template engine
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
         $this->left_delimiter  = '<{';
46 46
         $this->right_delimiter = '}>';
47 47
         $this->template_dir    = XOOPS_THEME_PATH;
48
-        $this->cache_dir       = XOOPS_VAR_PATH . '/caches/smarty_cache';
49
-        $this->compile_dir     = XOOPS_VAR_PATH . '/caches/smarty_compile';
48
+        $this->cache_dir       = XOOPS_VAR_PATH.'/caches/smarty_cache';
49
+        $this->compile_dir     = XOOPS_VAR_PATH.'/caches/smarty_compile';
50 50
         $this->compile_check   = ($xoopsConfig['theme_fromfile'] == 1);
51 51
         $this->plugins_dir     = array(
52
-            XOOPS_ROOT_PATH . '/class/smarty/xoops_plugins',
53
-            XOOPS_ROOT_PATH . '/class/smarty/plugins');
52
+            XOOPS_ROOT_PATH.'/class/smarty/xoops_plugins',
53
+            XOOPS_ROOT_PATH.'/class/smarty/plugins');
54 54
         if ($xoopsConfig['debug_mode']) {
55 55
             $this->debugging_ctrl = 'URL';
56 56
             if ($xoopsConfig['debug_mode'] == 3) {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function fetchFromData($tplSource, $display = false, $vars = null)
81 81
     {
82 82
         if (!function_exists('smarty_function_eval')) {
83
-            require_once SMARTY_DIR . '/plugins/function.eval.php';
83
+            require_once SMARTY_DIR.'/plugins/function.eval.php';
84 84
         }
85 85
         if (isset($vars)) {
86 86
             $oldVars = $this->_tpl_vars;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function _get_auto_id($cache_id = null, $compile_id = null)
124 124
     {
125 125
         if (isset($cache_id)) {
126
-            return isset($compile_id) ? $compile_id . '-' . $cache_id : $cache_id;
126
+            return isset($compile_id) ? $compile_id.'-'.$cache_id : $cache_id;
127 127
         } elseif (isset($compile_id)) {
128 128
             return $compile_id;
129 129
         } else {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $template_set      = empty($template_set) ? $xoopsConfig['template_set'] : $template_set;
147 147
         $theme_set         = empty($theme_set) ? $xoopsConfig['theme_set'] : $theme_set;
148 148
         $module_dirname    = empty($module_dirname) ? (empty($GLOBALS['xoopsModule']) ? 'system' : $GLOBALS['xoopsModule']->getVar('dirname', 'n')) : $module_dirname;
149
-        $this->compile_id  = substr(md5(XOOPS_URL), 0, 8) . '-' . $module_dirname . '-' . $theme_set . '-' . $template_set;
149
+        $this->compile_id  = substr(md5(XOOPS_URL), 0, 8).'-'.$module_dirname.'-'.$theme_set.'-'.$template_set;
150 150
         $this->_compile_id = $this->compile_id;
151 151
     }
152 152
 
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $compile_id = $this->compile_id;
164 164
         $this->setCompileId($module_dirname, $template_set, $theme_set);
165
-        $_params           = array(
165
+        $_params = array(
166 166
             'auto_base'   => $this->cache_dir,
167 167
             'auto_source' => null,
168 168
             'auto_id'     => $this->compile_id,
169 169
             'exp_time'    => null);
170 170
         $this->_compile_id = $this->compile_id = $compile_id;
171
-        require_once SMARTY_CORE_DIR . 'core.rm_auto.php';
171
+        require_once SMARTY_CORE_DIR.'core.rm_auto.php';
172 172
 
173 173
         return smarty_core_rm_auto($_params, $this);
174 174
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $file = $tplfile->getVar('tpl_file', 'n');
289 289
         $tpl  = new XoopsTpl();
290 290
 
291
-        return $tpl->touch('db:' . $file);
291
+        return $tpl->touch('db:'.$file);
292 292
     }
293 293
 
294 294
     return false;
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         $xoopsTpl->caching = 2;
310 310
         for ($i = 0; $i < $count; ++$i) {
311 311
             if ($block_arr[$i]->getVar('template') != '') {
312
-                $xoopsTpl->clear_cache('db:' . $block_arr[$i]->getVar('template'), 'blk_' . $block_arr[$i]->getVar('bid'));
312
+                $xoopsTpl->clear_cache('db:'.$block_arr[$i]->getVar('template'), 'blk_'.$block_arr[$i]->getVar('bid'));
313 313
             }
314 314
         }
315 315
     }
Please login to merge, or discard this patch.
htdocs/class/smarty/Smarty_Compiler.class.php 3 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
         // matches all valid variables (no quotes, no modifiers)
132 132
         $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|'
133
-           . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
133
+            . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
134 134
 
135 135
         // matches valid variable syntax:
136 136
         // $foo
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         // |foo|bar
173 173
         // |foo:$foo->bar
174 174
         $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|'
175
-           . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
175
+            . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
176 176
 
177 177
         // matches valid function name:
178 178
         // foo123
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         // "text"|bar
194 194
         // $foo->bar
195 195
         $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|'
196
-           . $this->_var_regexp . '|' . $this->_num_const_regexp  . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
196
+            . $this->_var_regexp . '|' . $this->_num_const_regexp  . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
197 197
 
198 198
         // matches valid parenthesised function parameters:
199 199
         //
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         // _foo_bar($foo,"bar")
211 211
         // foo123($foo,$foo->bar(),"foo")
212 212
         $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:'
213
-           . $this->_parenth_param_regexp . '))';
213
+            . $this->_parenth_param_regexp . '))';
214 214
     }
215 215
 
216 216
     /**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
         /* replace special blocks by "{php}" */
264 264
         $source_content = preg_replace_callback($search, array($this,'_preg_callback')
265
-                                       , $source_content);
265
+                                        , $source_content);
266 266
 
267 267
         /* Gather all template tags. */
268 268
         preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                 if ($postfilter === false) continue;
384 384
                 if ($postfilter[3] || is_callable($postfilter[0])) {
385 385
                     $compiled_content = call_user_func_array($postfilter[0],
386
-                                                              array($compiled_content, &$this));
386
+                                                                array($compiled_content, &$this));
387 387
                     $this->_plugins['postfilter'][$filter_name][3] = true;
388 388
                 } else {
389 389
                     $this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented");
@@ -644,8 +644,8 @@  discard block
 block discarded – undo
644 644
                 $output = call_user_func_array($plugin_func, array($tag_args, &$this));
645 645
                 if($output != '') {
646 646
                 $output = '<?php ' . $this->_push_cacheable_state('compiler', $tag_command)
647
-                                   . $output
648
-                                   . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>';
647
+                                    . $output
648
+                                    . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>';
649 649
                 }
650 650
             } else {
651 651
                 $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
@@ -751,9 +751,9 @@  discard block
 block discarded – undo
751 751
 
752 752
     function _preg_callback ($matches) {
753 753
     return $this->_quote_replace($this->left_delimiter)
754
-           . 'php'
755
-           . str_repeat("\n", substr_count($matches[1], "\n"))
756
-           . $this->_quote_replace($this->right_delimiter);
754
+            . 'php'
755
+            . str_repeat("\n", substr_count($matches[1], "\n"))
756
+            . $this->_quote_replace($this->right_delimiter);
757 757
     }
758 758
     /**
759 759
      * compile custom function tag
@@ -1108,7 +1108,7 @@  discard block
 block discarded – undo
1108 1108
             $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
1109 1109
         else
1110 1110
             $output .= "if ({$section_props}['max'] < 0)\n" .
1111
-                       "    {$section_props}['max'] = {$section_props}['loop'];\n";
1111
+                        "    {$section_props}['max'] = {$section_props}['loop'];\n";
1112 1112
 
1113 1113
         if (!isset($attrs['step']))
1114 1114
             $output .= "{$section_props}['step'] = 1;\n";
@@ -1117,9 +1117,9 @@  discard block
 block discarded – undo
1117 1117
             $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
1118 1118
         else {
1119 1119
             $output .= "if ({$section_props}['start'] < 0)\n" .
1120
-                       "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
1121
-                       "else\n" .
1122
-                       "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
1120
+                        "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
1121
+                        "else\n" .
1122
+                        "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
1123 1123
         }
1124 1124
 
1125 1125
         $output .= "if ({$section_props}['show']) {\n";
@@ -1129,9 +1129,9 @@  discard block
 block discarded – undo
1129 1129
             $output .= "    {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
1130 1130
         }
1131 1131
         $output .= "    if ({$section_props}['total'] == 0)\n" .
1132
-                   "        {$section_props}['show'] = false;\n" .
1133
-                   "} else\n" .
1134
-                   "    {$section_props}['total'] = 0;\n";
1132
+                    "        {$section_props}['show'] = false;\n" .
1133
+                    "} else\n" .
1134
+                    "    {$section_props}['total'] = 0;\n";
1135 1135
 
1136 1136
         $output .= "if ({$section_props}['show']):\n";
1137 1137
         $output .= "
@@ -1980,8 +1980,8 @@  discard block
 block discarded – undo
1980 1980
         }
1981 1981
         if (!isset($this->_plugin_info[$type][$name])) {
1982 1982
             $this->_plugin_info[$type][$name] = array($this->_current_file,
1983
-                                                      $this->_current_line_no,
1984
-                                                      $delayed_loading);
1983
+                                                        $this->_current_line_no,
1984
+                                                        $delayed_loading);
1985 1985
         }
1986 1986
     }
1987 1987
 
@@ -2049,7 +2049,7 @@  discard block
 block discarded – undo
2049 2049
             case 'get':
2050 2050
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2051 2051
                     $this->_syntax_error("(secure mode) super global access not permitted",
2052
-                                         E_USER_WARNING, __FILE__, __LINE__);
2052
+                                            E_USER_WARNING, __FILE__, __LINE__);
2053 2053
                     return;
2054 2054
                 }
2055 2055
                 $compiled_ref = "\$_GET";
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
             case 'post':
2059 2059
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2060 2060
                     $this->_syntax_error("(secure mode) super global access not permitted",
2061
-                                         E_USER_WARNING, __FILE__, __LINE__);
2061
+                                            E_USER_WARNING, __FILE__, __LINE__);
2062 2062
                     return;
2063 2063
                 }
2064 2064
                 $compiled_ref = "\$_POST";
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
             case 'cookies':
2068 2068
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2069 2069
                     $this->_syntax_error("(secure mode) super global access not permitted",
2070
-                                         E_USER_WARNING, __FILE__, __LINE__);
2070
+                                            E_USER_WARNING, __FILE__, __LINE__);
2071 2071
                     return;
2072 2072
                 }
2073 2073
                 $compiled_ref = "\$_COOKIE";
@@ -2076,7 +2076,7 @@  discard block
 block discarded – undo
2076 2076
             case 'env':
2077 2077
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2078 2078
                     $this->_syntax_error("(secure mode) super global access not permitted",
2079
-                                         E_USER_WARNING, __FILE__, __LINE__);
2079
+                                            E_USER_WARNING, __FILE__, __LINE__);
2080 2080
                     return;
2081 2081
                 }
2082 2082
                 $compiled_ref = "\$_ENV";
@@ -2085,7 +2085,7 @@  discard block
 block discarded – undo
2085 2085
             case 'server':
2086 2086
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2087 2087
                     $this->_syntax_error("(secure mode) super global access not permitted",
2088
-                                         E_USER_WARNING, __FILE__, __LINE__);
2088
+                                            E_USER_WARNING, __FILE__, __LINE__);
2089 2089
                     return;
2090 2090
                 }
2091 2091
                 $compiled_ref = "\$_SERVER";
@@ -2094,7 +2094,7 @@  discard block
 block discarded – undo
2094 2094
             case 'session':
2095 2095
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2096 2096
                     $this->_syntax_error("(secure mode) super global access not permitted",
2097
-                                         E_USER_WARNING, __FILE__, __LINE__);
2097
+                                            E_USER_WARNING, __FILE__, __LINE__);
2098 2098
                     return;
2099 2099
                 }
2100 2100
                 $compiled_ref = "\$_SESSION";
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
             case 'request':
2108 2108
                 if ($this->security && !$this->security_settings['ALLOW_SUPER_GLOBALS']) {
2109 2109
                     $this->_syntax_error("(secure mode) super global access not permitted",
2110
-                                         E_USER_WARNING, __FILE__, __LINE__);
2110
+                                            E_USER_WARNING, __FILE__, __LINE__);
2111 2111
                     return;
2112 2112
                 }
2113 2113
                 if ($this->request_use_auto_globals) {
@@ -2134,7 +2134,7 @@  discard block
 block discarded – undo
2134 2134
             case 'const':
2135 2135
                 if ($this->security && !$this->security_settings['ALLOW_CONSTANTS']) {
2136 2136
                     $this->_syntax_error("(secure mode) constants not permitted",
2137
-                                         E_USER_WARNING, __FILE__, __LINE__);
2137
+                                            E_USER_WARNING, __FILE__, __LINE__);
2138 2138
                     return;
2139 2139
                 }
2140 2140
                 array_shift($indexes);
@@ -2190,7 +2190,7 @@  discard block
 block discarded – undo
2190 2190
                 return ((is_object($this->_plugins[$type][$name][0][0])) ?
2191 2191
                         "\$this->_plugins['$type']['$name'][0][0]->"    /* method callback */
2192 2192
                         : (string)($this->_plugins[$type][$name][0][0]).'::'    /* class callback */
2193
-                       ). $this->_plugins[$type][$name][0][1];
2193
+                        ). $this->_plugins[$type][$name][0][1];
2194 2194
 
2195 2195
             } else {
2196 2196
                 /* function callback */
@@ -2335,7 +2335,7 @@  discard block
 block discarded – undo
2335 2335
             $message = " expected {/$_open_tag} (opened line $_line_no).";
2336 2336
         }
2337 2337
         $this->_syntax_error("mismatched tag {/$close_tag}.$message",
2338
-                             E_USER_ERROR, __FILE__, __LINE__);
2338
+                                E_USER_ERROR, __FILE__, __LINE__);
2339 2339
     }
2340 2340
 
2341 2341
 }
Please login to merge, or discard this patch.
Spacing   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -38,41 +38,41 @@  discard block
 block discarded – undo
38 38
     /**#@+
39 39
      * @access private
40 40
      */
41
-    var $_folded_blocks         =   array();    // keeps folded template blocks
42
-    var $_current_file          =   null;       // the current template being compiled
43
-    var $_current_line_no       =   1;          // line number for error messages
44
-    var $_capture_stack         =   array();    // keeps track of nested capture buffers
45
-    var $_plugin_info           =   array();    // keeps track of plugins to load
46
-    var $_init_smarty_vars      =   false;
47
-    var $_permitted_tokens      =   array('true','false','yes','no','on','off','null');
48
-    var $_db_qstr_regexp        =   null;        // regexps are setup in the constructor
49
-    var $_si_qstr_regexp        =   null;
50
-    var $_qstr_regexp           =   null;
51
-    var $_func_regexp           =   null;
52
-    var $_reg_obj_regexp        =   null;
53
-    var $_var_bracket_regexp    =   null;
54
-    var $_num_const_regexp      =   null;
55
-    var $_dvar_guts_regexp      =   null;
56
-    var $_dvar_regexp           =   null;
57
-    var $_cvar_regexp           =   null;
58
-    var $_svar_regexp           =   null;
59
-    var $_avar_regexp           =   null;
60
-    var $_mod_regexp            =   null;
61
-    var $_var_regexp            =   null;
62
-    var $_parenth_param_regexp  =   null;
63
-    var $_func_call_regexp      =   null;
64
-    var $_obj_ext_regexp        =   null;
65
-    var $_obj_start_regexp      =   null;
66
-    var $_obj_params_regexp     =   null;
67
-    var $_obj_call_regexp       =   null;
68
-    var $_cacheable_state       =   0;
69
-    var $_cache_attrs_count     =   0;
70
-    var $_nocache_count         =   0;
71
-    var $_cache_serial          =   null;
72
-    var $_cache_include         =   null;
73
-
74
-    var $_strip_depth           =   0;
75
-    var $_additional_newline    =   "\n";
41
+    var $_folded_blocks         = array(); // keeps folded template blocks
42
+    var $_current_file          = null; // the current template being compiled
43
+    var $_current_line_no       = 1; // line number for error messages
44
+    var $_capture_stack         = array(); // keeps track of nested capture buffers
45
+    var $_plugin_info           = array(); // keeps track of plugins to load
46
+    var $_init_smarty_vars      = false;
47
+    var $_permitted_tokens      = array('true', 'false', 'yes', 'no', 'on', 'off', 'null');
48
+    var $_db_qstr_regexp        = null; // regexps are setup in the constructor
49
+    var $_si_qstr_regexp        = null;
50
+    var $_qstr_regexp           = null;
51
+    var $_func_regexp           = null;
52
+    var $_reg_obj_regexp        = null;
53
+    var $_var_bracket_regexp    = null;
54
+    var $_num_const_regexp      = null;
55
+    var $_dvar_guts_regexp      = null;
56
+    var $_dvar_regexp           = null;
57
+    var $_cvar_regexp           = null;
58
+    var $_svar_regexp           = null;
59
+    var $_avar_regexp           = null;
60
+    var $_mod_regexp            = null;
61
+    var $_var_regexp            = null;
62
+    var $_parenth_param_regexp  = null;
63
+    var $_func_call_regexp      = null;
64
+    var $_obj_ext_regexp        = null;
65
+    var $_obj_start_regexp      = null;
66
+    var $_obj_params_regexp     = null;
67
+    var $_obj_call_regexp       = null;
68
+    var $_cacheable_state       = 0;
69
+    var $_cache_attrs_count     = 0;
70
+    var $_nocache_count         = 0;
71
+    var $_cache_serial          = null;
72
+    var $_cache_include         = null;
73
+
74
+    var $_strip_depth           = 0;
75
+    var $_additional_newline    = "\n";
76 76
 
77 77
     /**#@-*/
78 78
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
92 92
 
93 93
         // matches single or double quoted strings
94
-        $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')';
94
+        $this->_qstr_regexp = '(?:'.$this->_db_qstr_regexp.'|'.$this->_si_qstr_regexp.')';
95 95
 
96 96
         // matches bracket portion of vars
97 97
         // [0]
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
         // $foo[5].bar[$foobar][4]
116 116
         $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))';
117 117
         $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]';
118
-        $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp
119
-                . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?';
120
-        $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp;
118
+        $this->_dvar_guts_regexp = '\w+(?:'.$this->_var_bracket_regexp
119
+                . ')*(?:\.\$?\w+(?:'.$this->_var_bracket_regexp.')*)*(?:'.$this->_dvar_math_regexp.'(?:'.$this->_num_const_regexp.'|'.$this->_dvar_math_var_regexp.')*)?';
120
+        $this->_dvar_regexp = '\$'.$this->_dvar_guts_regexp;
121 121
 
122 122
         // matches config vars:
123 123
         // #foo#
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
         $this->_svar_regexp = '\%\w+\.\w+\%';
130 130
 
131 131
         // matches all valid variables (no quotes, no modifiers)
132
-        $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|'
133
-           . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
132
+        $this->_avar_regexp = '(?:'.$this->_dvar_regexp.'|'
133
+           . $this->_cvar_regexp.'|'.$this->_svar_regexp.')';
134 134
 
135 135
         // matches valid variable syntax:
136 136
         // $foo
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         // #foo#
140 140
         // "text"
141 141
         // "text"
142
-        $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
142
+        $this->_var_regexp = '(?:'.$this->_avar_regexp.'|'.$this->_qstr_regexp.')';
143 143
 
144 144
         // matches valid object call (one level of object nesting allowed in parameters):
145 145
         // $foo->bar
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
         // $foo->bar($foo->bar)
153 153
         // $foo->bar($foo->bar())
154 154
         // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar))
155
-        $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
155
+        $this->_obj_ext_regexp = '\->(?:\$?'.$this->_dvar_guts_regexp.')';
156 156
         $this->_obj_restricted_param_regexp = '(?:'
157
-                . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')'
158
-                . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)';
159
-        $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
160
-                . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)';
161
-        $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp
162
-                . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)';
163
-        $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
164
-        $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
157
+                . '(?:'.$this->_var_regexp.'|'.$this->_num_const_regexp.')(?:'.$this->_obj_ext_regexp.'(?:\((?:(?:'.$this->_var_regexp.'|'.$this->_num_const_regexp.')'
158
+                . '(?:\s*,\s*(?:'.$this->_var_regexp.'|'.$this->_num_const_regexp.'))*)?\))?)*)';
159
+        $this->_obj_single_param_regexp = '(?:\w+|'.$this->_obj_restricted_param_regexp.'(?:\s*,\s*(?:(?:\w+|'
160
+                . $this->_var_regexp.$this->_obj_restricted_param_regexp.')))*)';
161
+        $this->_obj_params_regexp = '\((?:'.$this->_obj_single_param_regexp
162
+                . '(?:\s*,\s*'.$this->_obj_single_param_regexp.')*)?\)';
163
+        $this->_obj_start_regexp = '(?:'.$this->_dvar_regexp.'(?:'.$this->_obj_ext_regexp.')+)';
164
+        $this->_obj_call_regexp = '(?:'.$this->_obj_start_regexp.'(?:'.$this->_obj_params_regexp.')?(?:'.$this->_dvar_math_regexp.'(?:'.$this->_num_const_regexp.'|'.$this->_dvar_math_var_regexp.')*)?)';
165 165
         
166 166
         // matches valid modifier syntax:
167 167
         // |foo
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
         // |foo:"bar":$foobar
172 172
         // |foo|bar
173 173
         // |foo:$foo->bar
174
-        $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|'
175
-           . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
174
+        $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|'.$this->_num_const_regexp.'|'
175
+           . $this->_obj_call_regexp.'|'.$this->_avar_regexp.'|'.$this->_qstr_regexp.'))*)';
176 176
 
177 177
         // matches valid function name:
178 178
         // foo123
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
         // "text"
193 193
         // "text"|bar
194 194
         // $foo->bar
195
-        $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|'
196
-           . $this->_var_regexp . '|' . $this->_num_const_regexp  . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
195
+        $this->_param_regexp = '(?:\s*(?:'.$this->_obj_call_regexp.'|'
196
+           . $this->_var_regexp.'|'.$this->_num_const_regexp.'|\w+)(?>'.$this->_mod_regexp.'*)\s*)';
197 197
 
198 198
         // matches valid parenthesised function parameters:
199 199
         //
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
         //    $foo, $bar, "text"
202 202
         // $foo|bar, "foo"|bar, $foo->bar($foo)|bar
203 203
         $this->_parenth_param_regexp = '(?:\((?:\w+|'
204
-                . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
205
-                . $this->_param_regexp . ')))*)?\))';
204
+                . $this->_param_regexp.'(?:\s*,\s*(?:(?:\w+|'
205
+                . $this->_param_regexp.')))*)?\))';
206 206
 
207 207
         // matches valid function call:
208 208
         // foo()
209 209
         // foo_bar($foo)
210 210
         // _foo_bar($foo,"bar")
211 211
         // foo123($foo,$foo->bar(),"foo")
212
-        $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:'
213
-           . $this->_parenth_param_regexp . '))';
212
+        $this->_func_call_regexp = '(?:'.$this->_func_regexp.'\s*(?:'
213
+           . $this->_parenth_param_regexp.'))';
214 214
     }
215 215
 
216 216
     /**
@@ -257,11 +257,11 @@  discard block
 block discarded – undo
257 257
         /* fetch all special blocks */
258 258
         $search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s";
259 259
 
260
-        preg_match_all($search, $source_content, $match,  PREG_SET_ORDER);
260
+        preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
261 261
         $this->_folded_blocks = $match;
262 262
 
263 263
         /* replace special blocks by "{php}" */
264
-        $source_content = preg_replace_callback($search, array($this,'_preg_callback')
264
+        $source_content = preg_replace_callback($search, array($this, '_preg_callback')
265 265
                                        , $source_content);
266 266
 
267 267
         /* Gather all template tags. */
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                 $sp_match[1] = array_unique($sp_match[1]);
279 279
                 usort($sp_match[1], '_smarty_sort_length');
280 280
                 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
281
-                    $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]);
281
+                    $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp], '%%%SMARTYSP'.$curr_sp.'%%%', $text_blocks[$curr_tb]);
282 282
                 }
283 283
                 /* process each one */
284 284
                 for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             $compiled_tags[] = $this->_compile_tag($template_tags[$i]);
308 308
             $this->_current_line_no += substr_count($template_tags[$i], "\n");
309 309
         }
310
-        if (count($this->_tag_stack)>0) {
310
+        if (count($this->_tag_stack) > 0) {
311 311
             list($_open_tag, $_line_no) = end($this->_tag_stack);
312 312
             $this->_syntax_error("unclosed tag \{$_open_tag} (opened line $_line_no).", E_USER_ERROR, __FILE__, __LINE__);
313 313
             return;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                         /* remove trailing whitespaces from the last text_block */
333 333
                         $text_blocks[$j] = rtrim($text_blocks[$j]);
334 334
                     }
335
-                    $text_blocks[$j] = "<?php echo '" . strtr($text_blocks[$j], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>";
335
+                    $text_blocks[$j] = "<?php echo '".strtr($text_blocks[$j], array("'"=>"\'", "\\"=>"\\\\"))."'; ?>";
336 336
                     if ($compiled_tags[$j] == '{/strip}') {
337 337
                         $compiled_tags[$j] = "\n"; /* slurped by php, but necessary
338 338
                                     if a newline is following the closing strip-tag */
@@ -345,19 +345,19 @@  discard block
 block discarded – undo
345 345
         }
346 346
         $compiled_content = '';
347 347
         
348
-        $tag_guard = '%%%SMARTYOTG' . md5(uniqid(rand(), true)) . '%%%';
348
+        $tag_guard = '%%%SMARTYOTG'.md5(uniqid(rand(), true)).'%%%';
349 349
         
350 350
         /* Interleave the compiled contents and text blocks to get the final result. */
351 351
         for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
352 352
             if ($compiled_tags[$i] == '') {
353 353
                 // tag result empty, remove first newline from following text block
354
-                $text_blocks[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i+1]);
354
+                $text_blocks[$i + 1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i + 1]);
355 355
             }
356 356
             // replace legit PHP tags with placeholder
357 357
             $text_blocks[$i] = str_replace('<?', $tag_guard, $text_blocks[$i]);
358 358
             $compiled_tags[$i] = str_replace('<?', $tag_guard, $compiled_tags[$i]);
359 359
             
360
-            $compiled_content .= $text_blocks[$i] . $compiled_tags[$i];
360
+            $compiled_content .= $text_blocks[$i].$compiled_tags[$i];
361 361
         }
362 362
         $compiled_content .= str_replace('<?', $tag_guard, $text_blocks[$i]);
363 363
 
@@ -369,12 +369,12 @@  discard block
 block discarded – undo
369 369
         $compiled_content = str_replace($tag_guard, '<?', $compiled_content); 
370 370
         
371 371
         // remove \n from the end of the file, if any
372
-        if (strlen($compiled_content) && (substr($compiled_content, -1) == "\n") ) {
372
+        if (strlen($compiled_content) && (substr($compiled_content, -1) == "\n")) {
373 373
             $compiled_content = substr($compiled_content, 0, -1);
374 374
         }
375 375
 
376 376
         if (!empty($this->_cache_serial)) {
377
-            $compiled_content = "<?php \$this->_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>" . $compiled_content;
377
+            $compiled_content = "<?php \$this->_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>".$compiled_content;
378 378
         }
379 379
 
380 380
         // run compiled template through postfilter functions
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             $_plugins_params = "array('plugins' => array(";
402 402
             foreach ($this->_plugin_info as $plugin_type => $plugins) {
403 403
                 foreach ($plugins as $plugin_name => $plugin_info) {
404
-                    $_plugins_params .= "array('$plugin_type', '$plugin_name', '" . strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\")) . "', $plugin_info[1], ";
404
+                    $_plugins_params .= "array('$plugin_type', '$plugin_name', '".strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\"))."', $plugin_info[1], ";
405 405
                     $_plugins_params .= $plugin_info[2] ? 'true),' : 'false),';
406 406
                 }
407 407
             }
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
             $this->_init_smarty_vars = false;
418 418
         }
419 419
 
420
-        $compiled_content = $template_header . $compiled_content;
420
+        $compiled_content = $template_header.$compiled_content;
421 421
         return true;
422 422
     }
423 423
 
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
             return '';
435 435
         
436 436
         /* Split tag into two three parts: command, command modifiers and the arguments. */
437
-        if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp
438
-                . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*))
437
+        if (!preg_match('~^(?:('.$this->_num_const_regexp.'|'.$this->_obj_call_regexp.'|'.$this->_var_regexp
438
+                . '|\/?'.$this->_reg_obj_regexp.'|\/?'.$this->_func_regexp.')('.$this->_mod_regexp.'*))
439 439
                       (?:\s+(.*))?$
440 440
                     ~xs', $template_tag, $match)) {
441 441
             $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__);
@@ -445,14 +445,14 @@  discard block
 block discarded – undo
445 445
         $tag_modifier = isset($match[2]) ? $match[2] : null;
446 446
         $tag_args = isset($match[3]) ? $match[3] : null;
447 447
 
448
-        if (preg_match('~^' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$~', $tag_command)) {
448
+        if (preg_match('~^'.$this->_num_const_regexp.'|'.$this->_obj_call_regexp.'|'.$this->_var_regexp.'$~', $tag_command)) {
449 449
             /* tag name is a variable or object */
450
-            $_return = $this->_parse_var_props($tag_command . $tag_modifier);
451
-            return "<?php echo $_return; ?>" . $this->_additional_newline;
450
+            $_return = $this->_parse_var_props($tag_command.$tag_modifier);
451
+            return "<?php echo $_return; ?>".$this->_additional_newline;
452 452
         }
453 453
 
454 454
         /* If the tag name is a registered object, we process it. */
455
-        if (preg_match('~^\/?' . $this->_reg_obj_regexp . '$~', $tag_command)) {
455
+        if (preg_match('~^\/?'.$this->_reg_obj_regexp.'$~', $tag_command)) {
456 456
             return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args), $tag_modifier);
457 457
         }
458 458
 
@@ -534,17 +534,17 @@  discard block
 block discarded – undo
534 534
 
535 535
             case 'strip':
536 536
             case '/strip':
537
-                if (substr($tag_command, 0, 1)=='/') {
537
+                if (substr($tag_command, 0, 1) == '/') {
538 538
                     $this->_pop_tag('strip');
539
-                    if (--$this->_strip_depth==0) { /* outermost closing {/strip} */
539
+                    if (--$this->_strip_depth == 0) { /* outermost closing {/strip} */
540 540
                         $this->_additional_newline = "\n";
541
-                        return '{' . $tag_command . '}';
541
+                        return '{'.$tag_command.'}';
542 542
                     }
543 543
                 } else {
544 544
                     $this->_push_tag('strip');
545
-                    if ($this->_strip_depth++==0) { /* outermost opening {strip} */
545
+                    if ($this->_strip_depth++ == 0) { /* outermost opening {strip} */
546 546
                         $this->_additional_newline = "";
547
-                        return '{' . $tag_command . '}';
547
+                        return '{'.$tag_command.'}';
548 548
                     }
549 549
                 }
550 550
                 return '';
@@ -560,14 +560,14 @@  discard block
 block discarded – undo
560 560
                         return '';
561 561
 
562 562
                     case 3: /* literal */
563
-                        return "<?php echo '" . strtr($block[2], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>" . $this->_additional_newline;
563
+                        return "<?php echo '".strtr($block[2], array("'"=>"\'", "\\"=>"\\\\"))."'; ?>".$this->_additional_newline;
564 564
 
565 565
                     case 4: /* php */
566 566
                         if ($this->security && !$this->security_settings['PHP_TAGS']) {
567 567
                             $this->_syntax_error("(secure mode) php tags not permitted", E_USER_WARNING, __FILE__, __LINE__);
568 568
                             return;
569 569
                         }
570
-                        return '<?php ' . $block[3] .' ?>';
570
+                        return '<?php '.$block[3].' ?>';
571 571
                 }
572 572
                 break;
573 573
 
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 
625 625
             include_once $plugin_file;
626 626
 
627
-            $plugin_func = 'smarty_compiler_' . $tag_command;
627
+            $plugin_func = 'smarty_compiler_'.$tag_command;
628 628
             if (!is_callable($plugin_func)) {
629 629
                 $message = "plugin function $plugin_func() not found in $plugin_file\n";
630 630
                 $have_function = false;
@@ -642,10 +642,10 @@  discard block
 block discarded – undo
642 642
         if ($found) {
643 643
             if ($have_function) {
644 644
                 $output = call_user_func_array($plugin_func, array($tag_args, &$this));
645
-                if($output != '') {
646
-                $output = '<?php ' . $this->_push_cacheable_state('compiler', $tag_command)
645
+                if ($output != '') {
646
+                $output = '<?php '.$this->_push_cacheable_state('compiler', $tag_command)
647 647
                                    . $output
648
-                                   . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>';
648
+                                   . $this->_pop_cacheable_state('compiler', $tag_command).' ?>';
649 649
                 }
650 650
             } else {
651 651
                 $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 
700 700
             include_once $plugin_file;
701 701
 
702
-            $plugin_func = 'smarty_block_' . $tag_command;
702
+            $plugin_func = 'smarty_block_'.$tag_command;
703 703
             if (!function_exists($plugin_func)) {
704 704
                 $message = "plugin function $plugin_func() not found in $plugin_file\n";
705 705
                 $have_function = false;
@@ -729,12 +729,12 @@  discard block
 block discarded – undo
729 729
             $this->_pop_tag($tag_command);
730 730
 
731 731
         if ($start_tag) {
732
-            $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);
732
+            $output = '<?php '.$this->_push_cacheable_state('block', $tag_command);
733 733
             $attrs = $this->_parse_attrs($tag_args);
734
-            $_cache_attrs='';
734
+            $_cache_attrs = '';
735 735
             $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs);
736 736
             $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); ';
737
-            $output .= '$_block_repeat=true;' . $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);';
737
+            $output .= '$_block_repeat=true;'.$this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);';
738 738
             $output .= 'while ($_block_repeat) { ob_start(); ?>';
739 739
         } else {
740 740
             $output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); ';
@@ -742,14 +742,14 @@  discard block
 block discarded – undo
742 742
             if ($tag_modifier != '') {
743 743
                 $this->_parse_modifiers($_out_tag_text, $tag_modifier);
744 744
             }
745
-            $output .= '$_block_repeat=false;echo ' . $_out_tag_text . '; } ';
746
-            $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>';
745
+            $output .= '$_block_repeat=false;echo '.$_out_tag_text.'; } ';
746
+            $output .= " array_pop(\$this->_tag_stack); ".$this->_pop_cacheable_state('block', $tag_command).'?>';
747 747
         }
748 748
 
749 749
         return true;
750 750
     }
751 751
 
752
-    function _preg_callback ($matches) {
752
+    function _preg_callback($matches) {
753 753
     return $this->_quote_replace($this->left_delimiter)
754 754
            . 'php'
755 755
            . str_repeat("\n", substr_count($matches[1], "\n"))
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 
790 790
             include_once $plugin_file;
791 791
 
792
-            $plugin_func = 'smarty_function_' . $tag_command;
792
+            $plugin_func = 'smarty_function_'.$tag_command;
793 793
             if (!function_exists($plugin_func)) {
794 794
                 $message = "plugin function $plugin_func() not found in $plugin_file\n";
795 795
                 $have_function = false;
@@ -816,13 +816,13 @@  discard block
 block discarded – undo
816 816
         $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs);
817 817
 
818 818
         $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)";
819
-        if($tag_modifier != '') {
819
+        if ($tag_modifier != '') {
820 820
             $this->_parse_modifiers($output, $tag_modifier);
821 821
         }
822 822
 
823
-        if($output != '') {
824
-            $output =  '<?php ' . $_cacheable_state . $_cache_attrs . 'echo ' . $output . ';'
825
-                . $this->_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline;
823
+        if ($output != '') {
824
+            $output = '<?php '.$_cacheable_state.$_cache_attrs.'echo '.$output.';'
825
+                . $this->_pop_cacheable_state('function', $tag_command)."?>".$this->_additional_newline;
826 826
         }
827 827
 
828 828
         return true;
@@ -848,10 +848,10 @@  discard block
 block discarded – undo
848 848
         list($object, $obj_comp) = explode('->', $tag_command);
849 849
 
850 850
         $arg_list = array();
851
-        if(count($attrs)) {
851
+        if (count($attrs)) {
852 852
             $_assign_var = false;
853 853
             foreach ($attrs as $arg_name => $arg_value) {
854
-                if($arg_name == 'assign') {
854
+                if ($arg_name == 'assign') {
855 855
                     $_assign_var = $arg_value;
856 856
                     unset($attrs['assign']);
857 857
                     continue;
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
             }
863 863
         }
864 864
 
865
-        if($this->_reg_objects[$object][2]) {
865
+        if ($this->_reg_objects[$object][2]) {
866 866
             // smarty object argument format
867 867
             $args = "array(".implode(',', (array)$arg_list)."), \$this";
868 868
         } else {
@@ -876,13 +876,13 @@  discard block
 block discarded – undo
876 876
         $prefix = '';
877 877
         $postfix = '';
878 878
         $newline = '';
879
-        if(!is_object($this->_reg_objects[$object][0])) {
880
-            $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
881
-        } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {
879
+        if (!is_object($this->_reg_objects[$object][0])) {
880
+            $this->_trigger_fatal_error("registered '$object' is not an object", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
881
+        } elseif (!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {
882 882
             $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
883
-        } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) {
883
+        } elseif (method_exists($this->_reg_objects[$object][0], $obj_comp)) {
884 884
             // method
885
-            if(in_array($obj_comp, $this->_reg_objects[$object][3])) {
885
+            if (in_array($obj_comp, $this->_reg_objects[$object][3])) {
886 886
                 // block method
887 887
                 if ($start_tag) {
888 888
                     $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); ";
@@ -904,22 +904,22 @@  discard block
 block discarded – undo
904 904
             $return = "\$this->_reg_objects['$object'][0]->$obj_comp";
905 905
         }
906 906
 
907
-        if($return != null) {
908
-            if($tag_modifier != '') {
907
+        if ($return != null) {
908
+            if ($tag_modifier != '') {
909 909
                 $this->_parse_modifiers($return, $tag_modifier);
910 910
             }
911 911
 
912
-            if(!empty($_assign_var)) {
913
-                $output = "\$this->assign('" . $this->_dequote($_assign_var) ."',  $return);";
912
+            if (!empty($_assign_var)) {
913
+                $output = "\$this->assign('".$this->_dequote($_assign_var)."',  $return);";
914 914
             } else {
915
-                $output = 'echo ' . $return . ';';
915
+                $output = 'echo '.$return.';';
916 916
                 $newline = $this->_additional_newline;
917 917
             }
918 918
         } else {
919 919
             $output = '';
920 920
         }
921 921
 
922
-        return '<?php ' . $prefix . $output . $postfix . "?>" . $newline;
922
+        return '<?php '.$prefix.$output.$postfix."?>".$newline;
923 923
     }
924 924
 
925 925
     /**
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 
958 958
         $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";
959 959
 
960
-        return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline;
960
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>".$this->_additional_newline;
961 961
     }
962 962
 
963 963
     /**
@@ -998,13 +998,13 @@  discard block
 block discarded – undo
998 998
             "\$_smarty_tpl_vars = \$this->_tpl_vars;\n";
999 999
 
1000 1000
 
1001
-        $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
1002
-        $output .= "\$this->_smarty_include($_params);\n" .
1003
-        "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
1001
+        $_params = "array('smarty_include_tpl_file' => ".$include_file.", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
1002
+        $output .= "\$this->_smarty_include($_params);\n".
1003
+        "\$this->_tpl_vars = \$_smarty_tpl_vars;\n".
1004 1004
         "unset(\$_smarty_tpl_vars);\n";
1005 1005
 
1006 1006
         if (isset($assign_var)) {
1007
-            $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n";
1007
+            $output .= "\$this->assign(".$assign_var.", ob_get_contents()); ob_end_clean();\n";
1008 1008
         }
1009 1009
 
1010 1010
         $output .= ' ?>';
@@ -1028,20 +1028,20 @@  discard block
 block discarded – undo
1028 1028
         }
1029 1029
 
1030 1030
         $assign_var = (empty($attrs['assign'])) ? '' : $this->_dequote($attrs['assign']);
1031
-        $once_var = (empty($attrs['once']) || $attrs['once']=='false') ? 'false' : 'true';
1031
+        $once_var = (empty($attrs['once']) || $attrs['once'] == 'false') ? 'false' : 'true';
1032 1032
 
1033 1033
         $arg_list = array();
1034
-        foreach($attrs as $arg_name => $arg_value) {
1035
-            if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') {
1036
-                if(is_bool($arg_value))
1034
+        foreach ($attrs as $arg_name => $arg_value) {
1035
+            if ($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') {
1036
+                if (is_bool($arg_value))
1037 1037
                     $arg_value = $arg_value ? 'true' : 'false';
1038 1038
                 $arg_list[] = "'$arg_name' => $arg_value";
1039 1039
             }
1040 1040
         }
1041 1041
 
1042
-        $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))";
1042
+        $_params = "array('smarty_file' => ".$attrs['file'].", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))";
1043 1043
 
1044
-        return "<?php require_once(SMARTY_CORE_DIR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>" . $this->_additional_newline;
1044
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>".$this->_additional_newline;
1045 1045
     }
1046 1046
 
1047 1047
 
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
         if (!isset($attrs['max']))
1108 1108
             $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
1109 1109
         else
1110
-            $output .= "if ({$section_props}['max'] < 0)\n" .
1110
+            $output .= "if ({$section_props}['max'] < 0)\n".
1111 1111
                        "    {$section_props}['max'] = {$section_props}['loop'];\n";
1112 1112
 
1113 1113
         if (!isset($attrs['step']))
@@ -1116,9 +1116,9 @@  discard block
 block discarded – undo
1116 1116
         if (!isset($attrs['start']))
1117 1117
             $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
1118 1118
         else {
1119
-            $output .= "if ({$section_props}['start'] < 0)\n" .
1120
-                       "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
1121
-                       "else\n" .
1119
+            $output .= "if ({$section_props}['start'] < 0)\n".
1120
+                       "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n".
1121
+                       "else\n".
1122 1122
                        "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
1123 1123
         }
1124 1124
 
@@ -1128,9 +1128,9 @@  discard block
 block discarded – undo
1128 1128
         } else {
1129 1129
             $output .= "    {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
1130 1130
         }
1131
-        $output .= "    if ({$section_props}['total'] == 0)\n" .
1132
-                   "        {$section_props}['show'] = false;\n" .
1133
-                   "} else\n" .
1131
+        $output .= "    if ({$section_props}['total'] == 0)\n".
1132
+                   "        {$section_props}['show'] = false;\n".
1133
+                   "} else\n".
1134 1134
                    "    {$section_props}['total'] = 0;\n";
1135 1135
 
1136 1136
         $output .= "if ({$section_props}['show']):\n";
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
         }
1176 1176
 
1177 1177
         if (isset($attrs['key'])) {
1178
-            $key  = $this->_dequote($attrs['key']);
1178
+            $key = $this->_dequote($attrs['key']);
1179 1179
             if (!preg_match('~^\w+$~', $key)) {
1180 1180
                 return $this->_syntax_error("foreach: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
1181 1181
             }
@@ -1255,8 +1255,8 @@  discard block
 block discarded – undo
1255 1255
 
1256 1256
         /* Tokenize args for 'if' tag. */
1257 1257
         preg_match_all('~(?>
1258
-                ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call
1259
-                ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)?    | # var or quoted string
1258
+                ' . $this->_obj_call_regexp.'(?:'.$this->_mod_regexp.'*)? | # valid object call
1259
+                ' . $this->_var_regexp.'(?:'.$this->_mod_regexp.'*)?    | # var or quoted string
1260 1260
                 \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@    | # valid non-word token
1261 1261
                 \b\w+\b                                                        | # valid word token
1262 1262
                 \S+                                                           # anything else
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
         $tokens = $match[0];
1266 1266
 
1267
-        if(empty($tokens)) {
1267
+        if (empty($tokens)) {
1268 1268
             $_error_msg = $elseif ? "'elseif'" : "'if'";
1269 1269
             $_error_msg .= ' statement requires arguments'; 
1270 1270
             $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__);
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
                 
1274 1274
         // make sure we have balanced parenthesis
1275 1275
         $token_count = array_count_values($tokens);
1276
-        if(isset($token_count['(']) && $token_count['('] != $token_count[')']) {
1276
+        if (isset($token_count['(']) && $token_count['('] != $token_count[')']) {
1277 1277
             $this->_syntax_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__);
1278 1278
         }
1279 1279
 
@@ -1363,15 +1363,15 @@  discard block
 block discarded – undo
1363 1363
                     /* If last token was a ')', we operate on the parenthesized
1364 1364
                        expression. The start of the expression is on the stack.
1365 1365
                        Otherwise, we operate on the last encountered token. */
1366
-                    if ($tokens[$i-1] == ')') {
1366
+                    if ($tokens[$i - 1] == ')') {
1367 1367
                         $is_arg_start = array_pop($is_arg_stack);
1368 1368
                         if ($is_arg_start != 0) {
1369
-                            if (preg_match('~^' . $this->_func_regexp . '$~', $tokens[$is_arg_start-1])) {
1369
+                            if (preg_match('~^'.$this->_func_regexp.'$~', $tokens[$is_arg_start - 1])) {
1370 1370
                                 $is_arg_start--;
1371 1371
                             } 
1372 1372
                         } 
1373 1373
                     } else
1374
-                        $is_arg_start = $i-1;
1374
+                        $is_arg_start = $i - 1;
1375 1375
                     /* Construct the argument for 'is' expression, so it knows
1376 1376
                        what to operate on. */
1377 1377
                     $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
                        return modified tokens, where the first one is the result
1382 1382
                        of the 'is' expression and the rest are the tokens it
1383 1383
                        didn't touch. */
1384
-                    $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
1384
+                    $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1));
1385 1385
 
1386 1386
                     /* Replace the old tokens with the new ones. */
1387 1387
                     array_splice($tokens, $is_arg_start, count($tokens), $new_tokens);
@@ -1392,19 +1392,19 @@  discard block
 block discarded – undo
1392 1392
                     break;
1393 1393
 
1394 1394
                 default:
1395
-                    if(preg_match('~^' . $this->_func_regexp . '$~', $token) ) {
1395
+                    if (preg_match('~^'.$this->_func_regexp.'$~', $token)) {
1396 1396
                             // function call
1397
-                            if($this->security &&
1397
+                            if ($this->security &&
1398 1398
                                !in_array($token, $this->security_settings['IF_FUNCS'])) {
1399 1399
                                 $this->_syntax_error("(secure mode) '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);
1400 1400
                             }
1401
-                    } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && (strpos('+-*/^%&|', substr($token, -1)) === false) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') {
1401
+                    } elseif (preg_match('~^'.$this->_var_regexp.'$~', $token) && (strpos('+-*/^%&|', substr($token, -1)) === false) && isset($tokens[$i + 1]) && $tokens[$i + 1] == '(') {
1402 1402
                         // variable function call
1403 1403
                         $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);                      
1404
-                    } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) {
1404
+                    } elseif (preg_match('~^'.$this->_obj_call_regexp.'|'.$this->_var_regexp.'(?:'.$this->_mod_regexp.'*)$~', $token)) {
1405 1405
                         // object or variable
1406 1406
                         $token = $this->_parse_var_props($token);
1407
-                    } elseif(is_numeric($token)) {
1407
+                    } elseif (is_numeric($token)) {
1408 1408
                         // number, skip it
1409 1409
                     } else {
1410 1410
                         $this->_syntax_error("unidentified token '$token'", E_USER_ERROR, __FILE__, __LINE__);
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
                 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
1477 1477
                     $expr_end++;
1478 1478
                     $expr_arg = $tokens[$expr_end++];
1479
-                    $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
1479
+                    $expr = "!(1 & ($is_arg / ".$this->_parse_var_props($expr_arg)."))";
1480 1480
                 } else
1481 1481
                     $expr = "!(1 & $is_arg)";
1482 1482
                 break;
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
                 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
1486 1486
                     $expr_end++;
1487 1487
                     $expr_arg = $tokens[$expr_end++];
1488
-                    $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
1488
+                    $expr = "(1 & ($is_arg / ".$this->_parse_var_props($expr_arg)."))";
1489 1489
                 } else
1490 1490
                     $expr = "(1 & $is_arg)";
1491 1491
                 break;
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
                 if (@$tokens[$expr_end] == 'by') {
1495 1495
                     $expr_end++;
1496 1496
                     $expr_arg = $tokens[$expr_end++];
1497
-                    $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")";
1497
+                    $expr = "!($is_arg % ".$this->_parse_var_props($expr_arg).")";
1498 1498
                 } else {
1499 1499
                     $this->_syntax_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__);
1500 1500
                 }
@@ -1525,11 +1525,11 @@  discard block
 block discarded – undo
1525 1525
     {
1526 1526
 
1527 1527
         /* Tokenize tag attributes. */
1528
-        preg_match_all('~(?:' . $this->_obj_call_regexp . '|' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+)
1528
+        preg_match_all('~(?:'.$this->_obj_call_regexp.'|'.$this->_qstr_regexp.' | (?>[^"\'=\s]+)
1529 1529
                          )+ |
1530 1530
                          [=]
1531 1531
                         ~x', $tag_args, $match);
1532
-        $tokens       = $match[0];
1532
+        $tokens = $match[0];
1533 1533
 
1534 1534
         $attrs = array();
1535 1535
         /* Parse state:
@@ -1570,9 +1570,9 @@  discard block
 block discarded – undo
1570 1570
                             $token = 'false';
1571 1571
                         } else if ($token == 'null') {
1572 1572
                             $token = 'null';
1573
-                        } else if (preg_match('~^' . $this->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) {
1573
+                        } else if (preg_match('~^'.$this->_num_const_regexp.'|0[xX][0-9a-fA-F]+$~', $token)) {
1574 1574
                             /* treat integer literally */
1575
-                        } else if (!preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$~', $token)) {
1575
+                        } else if (!preg_match('~^'.$this->_obj_call_regexp.'|'.$this->_var_regexp.'(?:'.$this->_mod_regexp.')*$~', $token)) {
1576 1576
                             /* treat as a string, double-quote it escaping quotes */
1577 1577
                             $token = '"'.addslashes($token).'"';
1578 1578
                         }
@@ -1586,8 +1586,8 @@  discard block
 block discarded – undo
1586 1586
             $last_token = $token;
1587 1587
         }
1588 1588
 
1589
-        if($state != 0) {
1590
-            if($state == 1) {
1589
+        if ($state != 0) {
1590
+            if ($state == 1) {
1591 1591
                 $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
1592 1592
             } else {
1593 1593
                 $this->_syntax_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__);
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
      */
1608 1608
     function _parse_vars_props(&$tokens)
1609 1609
     {
1610
-        foreach($tokens as $key => $val) {
1610
+        foreach ($tokens as $key => $val) {
1611 1611
             $tokens[$key] = $this->_parse_var_props($val);
1612 1612
         }
1613 1613
     }
@@ -1624,52 +1624,52 @@  discard block
 block discarded – undo
1624 1624
     {
1625 1625
         $val = trim($val);
1626 1626
 
1627
-        if(preg_match('~^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$~', $val, $match)) {
1627
+        if (preg_match('~^('.$this->_obj_call_regexp.'|'.$this->_dvar_regexp.')('.$this->_mod_regexp.'*)$~', $val, $match)) {
1628 1628
             // $ variable or object
1629 1629
             $return = $this->_parse_var($match[1]);
1630 1630
             $modifiers = $match[2];
1631
-            if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~',$modifiers)) {
1632
-                $_default_mod_string = implode('|',(array)$this->default_modifiers);
1633
-                $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
1631
+            if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~', $modifiers)) {
1632
+                $_default_mod_string = implode('|', (array)$this->default_modifiers);
1633
+                $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string.'|'.$modifiers;
1634 1634
             }
1635 1635
             $this->_parse_modifiers($return, $modifiers);
1636 1636
             return $return;
1637
-        } elseif (preg_match('~^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1637
+        } elseif (preg_match('~^'.$this->_db_qstr_regexp.'(?:'.$this->_mod_regexp.'*)$~', $val)) {
1638 1638
                 // double quoted text
1639
-                preg_match('~^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
1639
+                preg_match('~^('.$this->_db_qstr_regexp.')('.$this->_mod_regexp.'*)$~', $val, $match);
1640 1640
                 $return = $this->_expand_quoted_text($match[1]);
1641
-                if($match[2] != '') {
1641
+                if ($match[2] != '') {
1642 1642
                     $this->_parse_modifiers($return, $match[2]);
1643 1643
                 }
1644 1644
                 return $return;
1645 1645
             }
1646
-        elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1646
+        elseif (preg_match('~^'.$this->_num_const_regexp.'(?:'.$this->_mod_regexp.'*)$~', $val)) {
1647 1647
                 // numerical constant
1648
-                preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
1649
-                if($match[2] != '') {
1648
+                preg_match('~^('.$this->_num_const_regexp.')('.$this->_mod_regexp.'*)$~', $val, $match);
1649
+                if ($match[2] != '') {
1650 1650
                     $this->_parse_modifiers($match[1], $match[2]);
1651 1651
                     return $match[1];
1652 1652
                 }
1653 1653
             }
1654
-        elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1654
+        elseif (preg_match('~^'.$this->_si_qstr_regexp.'(?:'.$this->_mod_regexp.'*)$~', $val)) {
1655 1655
                 // single quoted text
1656
-                preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
1657
-                if($match[2] != '') {
1656
+                preg_match('~^('.$this->_si_qstr_regexp.')('.$this->_mod_regexp.'*)$~', $val, $match);
1657
+                if ($match[2] != '') {
1658 1658
                     $this->_parse_modifiers($match[1], $match[2]);
1659 1659
                     return $match[1];
1660 1660
                 }
1661 1661
             }
1662
-        elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1662
+        elseif (preg_match('~^'.$this->_cvar_regexp.'(?:'.$this->_mod_regexp.'*)$~', $val)) {
1663 1663
                 // config var
1664 1664
                 return $this->_parse_conf_var($val);
1665 1665
             }
1666
-        elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1666
+        elseif (preg_match('~^'.$this->_svar_regexp.'(?:'.$this->_mod_regexp.'*)$~', $val)) {
1667 1667
                 // section var
1668 1668
                 return $this->_parse_section_prop($val);
1669 1669
             }
1670
-        elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
1670
+        elseif (!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
1671 1671
             // literal string
1672
-            return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"');
1672
+            return $this->_expand_quoted_text('"'.strtr($val, array('\\' => '\\\\', '"' => '\\"')).'"');
1673 1673
         }
1674 1674
         return $val;
1675 1675
     }
@@ -1683,11 +1683,11 @@  discard block
 block discarded – undo
1683 1683
     function _expand_quoted_text($var_expr)
1684 1684
     {
1685 1685
         // if contains unescaped $, expand it
1686
-        if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
1686
+        if (preg_match_all('~(?:\`(?<!\\\\)\$'.$this->_dvar_guts_regexp.'(?:'.$this->_obj_ext_regexp.')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
1687 1687
             $_match = $_match[0];
1688 1688
             $_replace = array();
1689
-            foreach($_match as $_var) {
1690
-                $_replace[$_var] = '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."';
1689
+            foreach ($_match as $_var) {
1690
+                $_replace[$_var] = '".('.$this->_parse_var(str_replace('`', '', $_var)).')."';
1691 1691
             }
1692 1692
             $var_expr = strtr($var_expr, $_replace);
1693 1693
             $_return = preg_replace('~\.""|(?<!\\\\)""\.~', '', $var_expr);
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
             $_return = $var_expr;
1696 1696
         }
1697 1697
         // replace double quoted literal string with single quotes
1698
-        $_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return);
1698
+        $_return = preg_replace('~^"([\s\w]+)"$~', "'\\1'", $_return);
1699 1699
         return $_return;
1700 1700
     }
1701 1701
 
@@ -1711,26 +1711,26 @@  discard block
 block discarded – undo
1711 1711
         $_has_math = false;
1712 1712
         $_math_vars = preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE);
1713 1713
 
1714
-        if(count($_math_vars) > 1) {
1714
+        if (count($_math_vars) > 1) {
1715 1715
             $_first_var = "";
1716 1716
             $_complete_var = "";
1717 1717
             $_output = "";
1718 1718
             // simple check if there is any math, to stop recursion (due to modifiers with "xx % yy" as parameter)
1719
-            foreach($_math_vars as $_k => $_math_var) {
1719
+            foreach ($_math_vars as $_k => $_math_var) {
1720 1720
                 $_math_var = $_math_vars[$_k];
1721 1721
 
1722
-                if(!empty($_math_var) || is_numeric($_math_var)) {
1722
+                if (!empty($_math_var) || is_numeric($_math_var)) {
1723 1723
                     // hit a math operator, so process the stuff which came before it
1724
-                    if(preg_match('~^' . $this->_dvar_math_regexp . '$~', $_math_var)) {
1724
+                    if (preg_match('~^'.$this->_dvar_math_regexp.'$~', $_math_var)) {
1725 1725
                         $_has_math = true;
1726
-                        if(!empty($_complete_var) || is_numeric($_complete_var)) {
1726
+                        if (!empty($_complete_var) || is_numeric($_complete_var)) {
1727 1727
                             $_output .= $this->_parse_var($_complete_var);
1728 1728
                         }
1729 1729
 
1730 1730
                         // just output the math operator to php
1731 1731
                         $_output .= $_math_var;
1732 1732
 
1733
-                        if(empty($_first_var))
1733
+                        if (empty($_first_var))
1734 1734
                             $_first_var = $_complete_var;
1735 1735
 
1736 1736
                         $_complete_var = "";
@@ -1739,8 +1739,8 @@  discard block
 block discarded – undo
1739 1739
                     }
1740 1740
                 }
1741 1741
             }
1742
-            if($_has_math) {
1743
-                if(!empty($_complete_var) || is_numeric($_complete_var))
1742
+            if ($_has_math) {
1743
+                if (!empty($_complete_var) || is_numeric($_complete_var))
1744 1744
                     $_output .= $this->_parse_var($_complete_var);
1745 1745
 
1746 1746
                 // get the modifiers working (only the last var from math + modifier is left)
@@ -1749,15 +1749,15 @@  discard block
 block discarded – undo
1749 1749
         }
1750 1750
 
1751 1751
         // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit)
1752
-        if(is_numeric(substr($var_expr, 0, 1)))
1752
+        if (is_numeric(substr($var_expr, 0, 1)))
1753 1753
             $_var_ref = $var_expr;
1754 1754
         else
1755 1755
             $_var_ref = substr($var_expr, 1);
1756 1756
         
1757
-        if(!$_has_math) {
1757
+        if (!$_has_math) {
1758 1758
             
1759 1759
             // get [foo] and .foo and ->foo and (...) pieces
1760
-            preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match);
1760
+            preg_match_all('~(?:^\w+)|'.$this->_obj_params_regexp.'|(?:'.$this->_var_bracket_regexp.')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match);
1761 1761
                         
1762 1762
             $_indexes = $match[0];
1763 1763
             $_var_name = array_shift($_indexes);
@@ -1775,9 +1775,9 @@  discard block
 block discarded – undo
1775 1775
                     $_var_name = substr(array_shift($_indexes), 1);
1776 1776
                     $_output = "\$this->_smarty_vars['$_var_name']";
1777 1777
                 }
1778
-            } elseif(is_numeric($_var_name) && is_numeric(substr($var_expr, 0, 1))) {
1778
+            } elseif (is_numeric($_var_name) && is_numeric(substr($var_expr, 0, 1))) {
1779 1779
                 // because . is the operator for accessing arrays thru inidizes we need to put it together again for floating point numbers
1780
-                if(count($_indexes) > 0)
1780
+                if (count($_indexes) > 0)
1781 1781
                 {
1782 1782
                     $_var_name .= implode("", $_indexes);
1783 1783
                     $_indexes = array();
@@ -1794,9 +1794,9 @@  discard block
 block discarded – undo
1794 1794
                         $_output .= "[$_index]";
1795 1795
                     } elseif (substr($_index, 0, 1) == '$') {
1796 1796
                         if (strpos($_index, '.') !== false) {
1797
-                            $_output .= '[' . $this->_parse_var($_index) . ']';
1797
+                            $_output .= '['.$this->_parse_var($_index).']';
1798 1798
                         } else {
1799
-                            $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]";
1799
+                            $_output .= "[\$this->_tpl_vars['".substr($_index, 1)."']]";
1800 1800
                         }
1801 1801
                     } else {
1802 1802
                         $_var_parts = explode('.', $_index);
@@ -1806,19 +1806,19 @@  discard block
 block discarded – undo
1806 1806
                     }
1807 1807
                 } else if (substr($_index, 0, 1) == '.') {
1808 1808
                     if (substr($_index, 1, 1) == '$')
1809
-                        $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]";
1809
+                        $_output .= "[\$this->_tpl_vars['".substr($_index, 2)."']]";
1810 1810
                     else
1811
-                        $_output .= "['" . substr($_index, 1) . "']";
1812
-                } else if (substr($_index,0,2) == '->') {
1813
-                    if(substr($_index,2,2) == '__') {
1811
+                        $_output .= "['".substr($_index, 1)."']";
1812
+                } else if (substr($_index, 0, 2) == '->') {
1813
+                    if (substr($_index, 2, 2) == '__') {
1814 1814
                         $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
1815
-                    } elseif($this->security && substr($_index, 2, 1) == '_') {
1815
+                    } elseif ($this->security && substr($_index, 2, 1) == '_') {
1816 1816
                         $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
1817 1817
                     } elseif (substr($_index, 2, 1) == '$') {
1818 1818
                         if ($this->security) {
1819 1819
                             $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
1820 1820
                         } else {
1821
-                            $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}';
1821
+                            $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index, 3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}';
1822 1822
                         }
1823 1823
                     } else {
1824 1824
                         $_output .= $_index;
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
      */
1844 1844
     function _parse_parenth_args($parenth_args)
1845 1845
     {
1846
-        preg_match_all('~' . $this->_param_regexp . '~',$parenth_args, $match);
1846
+        preg_match_all('~'.$this->_param_regexp.'~', $parenth_args, $match);
1847 1847
         $orig_vals = $match = $match[0];
1848 1848
         $this->_parse_vars_props($match);
1849 1849
         $replace = array();
@@ -1906,18 +1906,18 @@  discard block
 block discarded – undo
1906 1906
      */
1907 1907
     function _parse_modifiers(&$output, $modifier_string)
1908 1908
     {
1909
-        preg_match_all('~\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)~', '|' . $modifier_string, $_match);
1909
+        preg_match_all('~\|(@?\w+)((?>:(?:'.$this->_qstr_regexp.'|[^|]+))*)~', '|'.$modifier_string, $_match);
1910 1910
         list(, $_modifiers, $modifier_arg_strings) = $_match;
1911 1911
 
1912 1912
         for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {
1913 1913
             $_modifier_name = $_modifiers[$_i];
1914 1914
 
1915
-            if($_modifier_name == 'smarty') {
1915
+            if ($_modifier_name == 'smarty') {
1916 1916
                 // skip smarty modifier
1917 1917
                 continue;
1918 1918
             }
1919 1919
 
1920
-            preg_match_all('~:(' . $this->_qstr_regexp . '|[^:]+)~', $modifier_arg_strings[$_i], $_match);
1920
+            preg_match_all('~:('.$this->_qstr_regexp.'|[^:]+)~', $modifier_arg_strings[$_i], $_match);
1921 1921
             $_modifier_args = $_match[1];
1922 1922
 
1923 1923
             if (substr($_modifier_name, 0, 1) == '@') {
@@ -1931,22 +1931,22 @@  discard block
 block discarded – undo
1931 1931
                 && !$this->_get_plugin_filepath('modifier', $_modifier_name)
1932 1932
                 && function_exists($_modifier_name)) {
1933 1933
                 if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
1934
-                    $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
1934
+                    $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
1935 1935
                 } else {
1936
-                    $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name,  null, null, false);
1936
+                    $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false);
1937 1937
                 }
1938 1938
             }
1939 1939
             $this->_add_plugin('modifier', $_modifier_name);
1940 1940
 
1941 1941
             $this->_parse_vars_props($_modifier_args);
1942 1942
 
1943
-            if($_modifier_name == 'default') {
1943
+            if ($_modifier_name == 'default') {
1944 1944
                 // supress notifications of default modifier vars and args
1945
-                if(substr($output, 0, 1) == '$') {
1946
-                    $output = '@' . $output;
1945
+                if (substr($output, 0, 1) == '$') {
1946
+                    $output = '@'.$output;
1947 1947
                 }
1948
-                if(isset($_modifier_args[0]) && substr($_modifier_args[0], 0, 1) == '$') {
1949
-                    $_modifier_args[0] = '@' . $_modifier_args[0];
1948
+                if (isset($_modifier_args[0]) && substr($_modifier_args[0], 0, 1) == '$') {
1949
+                    $_modifier_args[0] = '@'.$_modifier_args[0];
1950 1950
                 }
1951 1951
             }
1952 1952
             if (count($_modifier_args) > 0)
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
                 $_modifier_args = '';
1956 1956
 
1957 1957
             if ($_map_array) {
1958
-                $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))";
1958
+                $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : ".$this->_compile_plugin_call('modifier', $_modifier_name)."(\$_tmp$_modifier_args))";
1959 1959
 
1960 1960
             } else {
1961 1961
 
@@ -1996,9 +1996,9 @@  discard block
 block discarded – undo
1996 1996
     {
1997 1997
         /* Extract the reference name. */
1998 1998
         $_ref = substr($indexes[0], 1);
1999
-        foreach($indexes as $_index_no=>$_index) {
2000
-            if (substr($_index, 0, 1) != '.' && $_index_no<2 || !preg_match('~^(\.|\[|->)~', $_index)) {
2001
-                $this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
1999
+        foreach ($indexes as $_index_no=>$_index) {
2000
+            if (substr($_index, 0, 1) != '.' && $_index_no < 2 || !preg_match('~^(\.|\[|->)~', $_index)) {
2001
+                $this->_syntax_error('$smarty'.implode('', array_slice($indexes, 0, 2)).' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
2002 2002
             }
2003 2003
         }
2004 2004
 
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
                 return null;
2123 2123
 
2124 2124
             case 'template':
2125
-                $compiled_ref = "'" . addslashes($this->_current_file) . "'";
2125
+                $compiled_ref = "'".addslashes($this->_current_file)."'";
2126 2126
                 $_max_index = 1;
2127 2127
                 break;
2128 2128
 
@@ -2139,10 +2139,10 @@  discard block
 block discarded – undo
2139 2139
                 }
2140 2140
                 array_shift($indexes);
2141 2141
                 if (preg_match('!^\.\w+$!', $indexes[0])) {
2142
-                    $compiled_ref = '@' . substr($indexes[0], 1);
2142
+                    $compiled_ref = '@'.substr($indexes[0], 1);
2143 2143
                 } else {
2144 2144
                     $_val = $this->_parse_var_props(substr($indexes[0], 1));
2145
-                    $compiled_ref = '@constant(' . $_val . ')';
2145
+                    $compiled_ref = '@constant('.$_val.')';
2146 2146
                 }
2147 2147
                 $_max_index = 1;
2148 2148
                 break;
@@ -2161,12 +2161,12 @@  discard block
 block discarded – undo
2161 2161
                 break;
2162 2162
                 
2163 2163
             default:
2164
-                $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__);
2164
+                $this->_syntax_error('$smarty.'.$_ref.' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__);
2165 2165
                 break;
2166 2166
         }
2167 2167
 
2168 2168
         if (isset($_max_index) && count($indexes) > $_max_index) {
2169
-            $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
2169
+            $this->_syntax_error('$smarty'.implode('', $indexes).' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
2170 2170
         }
2171 2171
 
2172 2172
         array_shift($indexes);
@@ -2190,7 +2190,7 @@  discard block
 block discarded – undo
2190 2190
                 return ((is_object($this->_plugins[$type][$name][0][0])) ?
2191 2191
                         "\$this->_plugins['$type']['$name'][0][0]->"    /* method callback */
2192 2192
                         : (string)($this->_plugins[$type][$name][0][0]).'::'    /* class callback */
2193
-                       ). $this->_plugins[$type][$name][0][1];
2193
+                       ).$this->_plugins[$type][$name][0][1];
2194 2194
 
2195 2195
             } else {
2196 2196
                 /* function callback */
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
                 if ($prefilter === false) {
2215 2215
                     unset($this->_plugins['prefilter'][$filter_name]);
2216 2216
                     $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false)));
2217
-                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
2217
+                    require_once(SMARTY_CORE_DIR.'core.load_plugins.php');
2218 2218
                     smarty_core_load_plugins($_params, $this);
2219 2219
                 }
2220 2220
             }
@@ -2224,7 +2224,7 @@  discard block
 block discarded – undo
2224 2224
                 if ($postfilter === false) {
2225 2225
                     unset($this->_plugins['postfilter'][$filter_name]);
2226 2226
                     $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false)));
2227
-                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
2227
+                    require_once(SMARTY_CORE_DIR.'core.load_plugins.php');
2228 2228
                     smarty_core_load_plugins($_params, $this);
2229 2229
                 }
2230 2230
             }
@@ -2251,7 +2251,7 @@  discard block
 block discarded – undo
2251 2251
      * @param string $file
2252 2252
      * @param integer $line
2253 2253
      */
2254
-    function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
2254
+    function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file = null, $line = null)
2255 2255
     {
2256 2256
         $this->_trigger_fatal_error("syntax error: $error_msg", $this->_current_file, $this->_current_line_no, $file, $line, $error_type);
2257 2257
     }
@@ -2266,10 +2266,10 @@  discard block
 block discarded – undo
2266 2266
     function _push_cacheable_state($type, $name) {
2267 2267
         $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
2268 2268
         if ($_cacheable
2269
-            || 0<$this->_cacheable_state++) return '';
2269
+            || 0 < $this->_cacheable_state++) return '';
2270 2270
         if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty'));
2271 2271
         $_ret = 'if ($this->caching && !$this->_cache_including): echo \'{nocache:'
2272
-            . $this->_cache_serial . '#' . $this->_nocache_count
2272
+            . $this->_cache_serial.'#'.$this->_nocache_count
2273 2273
             . '}\'; endif;';
2274 2274
         return $_ret;
2275 2275
     }
@@ -2284,9 +2284,9 @@  discard block
 block discarded – undo
2284 2284
     function _pop_cacheable_state($type, $name) {
2285 2285
         $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
2286 2286
         if ($_cacheable
2287
-            || --$this->_cacheable_state>0) return '';
2287
+            || --$this->_cacheable_state > 0) return '';
2288 2288
         return 'if ($this->caching && !$this->_cache_including): echo \'{/nocache:'
2289
-            . $this->_cache_serial . '#' . ($this->_nocache_count++)
2289
+            . $this->_cache_serial.'#'.($this->_nocache_count++)
2290 2290
             . '}\'; endif;';
2291 2291
     }
2292 2292
 
@@ -2309,12 +2309,12 @@  discard block
 block discarded – undo
2309 2309
     function _pop_tag($close_tag)
2310 2310
     {
2311 2311
         $message = '';
2312
-        if (count($this->_tag_stack)>0) {
2312
+        if (count($this->_tag_stack) > 0) {
2313 2313
             list($_open_tag, $_line_no) = array_pop($this->_tag_stack);
2314 2314
             if ($close_tag == $_open_tag) {
2315 2315
                 return $_open_tag;
2316 2316
             }
2317
-            if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif' )) {
2317
+            if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif')) {
2318 2318
                 return $this->_pop_tag($close_tag);
2319 2319
             }
2320 2320
             if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
@@ -2350,10 +2350,10 @@  discard block
 block discarded – undo
2350 2350
  */
2351 2351
 function _smarty_sort_length($a, $b)
2352 2352
 {
2353
-    if($a == $b)
2353
+    if ($a == $b)
2354 2354
         return 0;
2355 2355
 
2356
-    if(strlen($a) == strlen($b))
2356
+    if (strlen($a) == strlen($b))
2357 2357
         return ($a > $b) ? -1 : 1;
2358 2358
 
2359 2359
     return (strlen($a) > strlen($b)) ? -1 : 1;
Please login to merge, or discard this patch.
Braces   +145 added lines, -106 removed lines patch added patch discarded remove patch
@@ -243,7 +243,9 @@  discard block
 block discarded – undo
243 243
         // run template source through prefilter functions
244 244
         if (count($this->_plugins['prefilter']) > 0) {
245 245
             foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
246
-                if ($prefilter === false) continue;
246
+                if ($prefilter === false) {
247
+                    continue;
248
+                }
247 249
                 if ($prefilter[3] || is_callable($prefilter[0])) {
248 250
                     $source_content = call_user_func_array($prefilter[0],
249 251
                                                             array($source_content, &$this));
@@ -380,7 +382,9 @@  discard block
 block discarded – undo
380 382
         // run compiled template through postfilter functions
381 383
         if (count($this->_plugins['postfilter']) > 0) {
382 384
             foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
383
-                if ($postfilter === false) continue;
385
+                if ($postfilter === false) {
386
+                    continue;
387
+                }
384 388
                 if ($postfilter[3] || is_callable($postfilter[0])) {
385 389
                     $compiled_content = call_user_func_array($postfilter[0],
386 390
                                                               array($compiled_content, &$this));
@@ -430,8 +434,9 @@  discard block
 block discarded – undo
430 434
     function _compile_tag($template_tag)
431 435
     {
432 436
         /* Matched comment. */
433
-        if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*')
434
-            return '';
437
+        if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*') {
438
+                    return '';
439
+        }
435 440
         
436 441
         /* Split tag into two three parts: command, command modifiers and the arguments. */
437 442
         if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp
@@ -469,18 +474,21 @@  discard block
 block discarded – undo
469 474
 
470 475
             case 'else':
471 476
                 list($_open_tag) = end($this->_tag_stack);
472
-                if ($_open_tag != 'if' && $_open_tag != 'elseif')
473
-                    $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__);
474
-                else
475
-                    $this->_push_tag('else');
477
+                if ($_open_tag != 'if' && $_open_tag != 'elseif') {
478
+                                    $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__);
479
+                } else {
480
+                                    $this->_push_tag('else');
481
+                }
476 482
                 return '<?php else: ?>';
477 483
 
478 484
             case 'elseif':
479 485
                 list($_open_tag) = end($this->_tag_stack);
480
-                if ($_open_tag != 'if' && $_open_tag != 'elseif')
481
-                    $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__);
482
-                if ($_open_tag == 'if')
483
-                    $this->_push_tag('elseif');
486
+                if ($_open_tag != 'if' && $_open_tag != 'elseif') {
487
+                                    $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__);
488
+                }
489
+                if ($_open_tag == 'if') {
490
+                                    $this->_push_tag('elseif');
491
+                }
484 492
                 return $this->_compile_if_tag($tag_args, true);
485 493
 
486 494
             case '/if':
@@ -510,10 +518,11 @@  discard block
 block discarded – undo
510 518
 
511 519
             case '/section':
512 520
                 $_open_tag = $this->_pop_tag('section');
513
-                if ($_open_tag == 'sectionelse')
514
-                    return "<?php endif; ?>";
515
-                else
516
-                    return "<?php endfor; endif; ?>";
521
+                if ($_open_tag == 'sectionelse') {
522
+                                    return "<?php endif; ?>";
523
+                } else {
524
+                                    return "<?php endfor; endif; ?>";
525
+                }
517 526
 
518 527
             case 'foreach':
519 528
                 $this->_push_tag('foreach');
@@ -526,10 +535,11 @@  discard block
 block discarded – undo
526 535
 
527 536
             case '/foreach':
528 537
                 $_open_tag = $this->_pop_tag('foreach');
529
-                if ($_open_tag == 'foreachelse')
530
-                    return "<?php endif; unset(\$_from); ?>";
531
-                else
532
-                    return "<?php endforeach; endif; unset(\$_from); ?>";
538
+                if ($_open_tag == 'foreachelse') {
539
+                                    return "<?php endif; unset(\$_from); ?>";
540
+                } else {
541
+                                    return "<?php endforeach; endif; unset(\$_from); ?>";
542
+                }
533 543
                 break;
534 544
 
535 545
             case 'strip':
@@ -672,8 +682,9 @@  discard block
 block discarded – undo
672 682
         if (substr($tag_command, 0, 1) == '/') {
673 683
             $start_tag = false;
674 684
             $tag_command = substr($tag_command, 1);
675
-        } else
676
-            $start_tag = true;
685
+        } else {
686
+                    $start_tag = true;
687
+        }
677 688
 
678 689
         $found = false;
679 690
         $have_function = true;
@@ -723,10 +734,11 @@  discard block
 block discarded – undo
723 734
          */
724 735
         $this->_add_plugin('block', $tag_command);
725 736
 
726
-        if ($start_tag)
727
-            $this->_push_tag($tag_command);
728
-        else
729
-            $this->_pop_tag($tag_command);
737
+        if ($start_tag) {
738
+                    $this->_push_tag($tag_command);
739
+        } else {
740
+                    $this->_pop_tag($tag_command);
741
+        }
730 742
 
731 743
         if ($start_tag) {
732 744
             $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);
@@ -856,8 +868,9 @@  discard block
 block discarded – undo
856 868
                     unset($attrs['assign']);
857 869
                     continue;
858 870
                 }
859
-                if (is_bool($arg_value))
860
-                    $arg_value = $arg_value ? 'true' : 'false';
871
+                if (is_bool($arg_value)) {
872
+                                    $arg_value = $arg_value ? 'true' : 'false';
873
+                }
861 874
                 $arg_list[] = "'$arg_name' => $arg_value";
862 875
             }
863 876
         }
@@ -948,8 +961,9 @@  discard block
 block discarded – undo
948 961
         }
949 962
 
950 963
         foreach ($attrs as $arg_name => $arg_value) {
951
-            if (is_bool($arg_value))
952
-                $arg_value = $arg_value ? 'true' : 'false';
964
+            if (is_bool($arg_value)) {
965
+                            $arg_value = $arg_value ? 'true' : 'false';
966
+            }
953 967
             $arg_list[] = "'$arg_name' => $arg_value";
954 968
         }
955 969
 
@@ -983,8 +997,9 @@  discard block
 block discarded – undo
983 997
                 $assign_var = $arg_value;
984 998
                 continue;
985 999
             }
986
-            if (is_bool($arg_value))
987
-                $arg_value = $arg_value ? 'true' : 'false';
1000
+            if (is_bool($arg_value)) {
1001
+                            $arg_value = $arg_value ? 'true' : 'false';
1002
+            }
988 1003
             $arg_list[] = "'$arg_name' => $arg_value";
989 1004
         }
990 1005
 
@@ -1033,8 +1048,9 @@  discard block
 block discarded – undo
1033 1048
         $arg_list = array();
1034 1049
         foreach($attrs as $arg_name => $arg_value) {
1035 1050
             if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') {
1036
-                if(is_bool($arg_value))
1037
-                    $arg_value = $arg_value ? 'true' : 'false';
1051
+                if(is_bool($arg_value)) {
1052
+                                    $arg_value = $arg_value ? 'true' : 'false';
1053
+                }
1038 1054
                 $arg_list[] = "'$arg_name' => $arg_value";
1039 1055
             }
1040 1056
         }
@@ -1072,10 +1088,11 @@  discard block
 block discarded – undo
1072 1088
                     break;
1073 1089
 
1074 1090
                 case 'show':
1075
-                    if (is_bool($attr_value))
1076
-                        $show_attr_value = $attr_value ? 'true' : 'false';
1077
-                    else
1078
-                        $show_attr_value = "(bool)$attr_value";
1091
+                    if (is_bool($attr_value)) {
1092
+                                            $show_attr_value = $attr_value ? 'true' : 'false';
1093
+                    } else {
1094
+                                            $show_attr_value = "(bool)$attr_value";
1095
+                    }
1079 1096
                     $output .= "{$section_props}['show'] = $show_attr_value;\n";
1080 1097
                     break;
1081 1098
 
@@ -1098,24 +1115,28 @@  discard block
 block discarded – undo
1098 1115
             }
1099 1116
         }
1100 1117
 
1101
-        if (!isset($attrs['show']))
1102
-            $output .= "{$section_props}['show'] = true;\n";
1118
+        if (!isset($attrs['show'])) {
1119
+                    $output .= "{$section_props}['show'] = true;\n";
1120
+        }
1103 1121
 
1104
-        if (!isset($attrs['loop']))
1105
-            $output .= "{$section_props}['loop'] = 1;\n";
1122
+        if (!isset($attrs['loop'])) {
1123
+                    $output .= "{$section_props}['loop'] = 1;\n";
1124
+        }
1106 1125
 
1107
-        if (!isset($attrs['max']))
1108
-            $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
1109
-        else
1110
-            $output .= "if ({$section_props}['max'] < 0)\n" .
1126
+        if (!isset($attrs['max'])) {
1127
+                    $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
1128
+        } else {
1129
+                    $output .= "if ({$section_props}['max'] < 0)\n" .
1111 1130
                        "    {$section_props}['max'] = {$section_props}['loop'];\n";
1131
+        }
1112 1132
 
1113
-        if (!isset($attrs['step']))
1114
-            $output .= "{$section_props}['step'] = 1;\n";
1133
+        if (!isset($attrs['step'])) {
1134
+                    $output .= "{$section_props}['step'] = 1;\n";
1135
+        }
1115 1136
 
1116
-        if (!isset($attrs['start']))
1117
-            $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
1118
-        else {
1137
+        if (!isset($attrs['start'])) {
1138
+                    $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
1139
+        } else {
1119 1140
             $output .= "if ({$section_props}['start'] < 0)\n" .
1120 1141
                        "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
1121 1142
                        "else\n" .
@@ -1370,8 +1391,9 @@  discard block
 block discarded – undo
1370 1391
                                 $is_arg_start--;
1371 1392
                             } 
1372 1393
                         } 
1373
-                    } else
1374
-                        $is_arg_start = $i-1;
1394
+                    } else {
1395
+                                            $is_arg_start = $i-1;
1396
+                    }
1375 1397
                     /* Construct the argument for 'is' expression, so it knows
1376 1398
                        what to operate on. */
1377 1399
                     $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
@@ -1413,10 +1435,11 @@  discard block
 block discarded – undo
1413 1435
             }
1414 1436
         }
1415 1437
 
1416
-        if ($elseif)
1417
-            return '<?php elseif ('.implode(' ', $tokens).'): ?>';
1418
-        else
1419
-            return '<?php if ('.implode(' ', $tokens).'): ?>';
1438
+        if ($elseif) {
1439
+                    return '<?php elseif ('.implode(' ', $tokens).'): ?>';
1440
+        } else {
1441
+                    return '<?php if ('.implode(' ', $tokens).'): ?>';
1442
+        }
1420 1443
     }
1421 1444
 
1422 1445
 
@@ -1440,10 +1463,12 @@  discard block
 block discarded – undo
1440 1463
         }
1441 1464
 
1442 1465
         foreach ($attrs as $arg_name => $arg_value) {
1443
-            if (is_bool($arg_value))
1444
-                $arg_value = $arg_value ? 'true' : 'false';
1445
-            if (is_null($arg_value))
1446
-                $arg_value = 'null';
1466
+            if (is_bool($arg_value)) {
1467
+                            $arg_value = $arg_value ? 'true' : 'false';
1468
+            }
1469
+            if (is_null($arg_value)) {
1470
+                            $arg_value = 'null';
1471
+            }
1447 1472
             if ($_cache_attrs && in_array($arg_name, $_cache_attrs)) {
1448 1473
                 $arg_list[] = "'$arg_name' => (\$this->_cache_including) ? \$_cache_attrs['$arg_name'] : (\$_cache_attrs['$arg_name']=$arg_value)";
1449 1474
             } else {
@@ -1468,8 +1493,9 @@  discard block
 block discarded – undo
1468 1493
         if (($first_token = array_shift($tokens)) == 'not') {
1469 1494
             $negate_expr = true;
1470 1495
             $expr_type = array_shift($tokens);
1471
-        } else
1472
-            $expr_type = $first_token;
1496
+        } else {
1497
+                    $expr_type = $first_token;
1498
+        }
1473 1499
 
1474 1500
         switch ($expr_type) {
1475 1501
             case 'even':
@@ -1477,8 +1503,9 @@  discard block
 block discarded – undo
1477 1503
                     $expr_end++;
1478 1504
                     $expr_arg = $tokens[$expr_end++];
1479 1505
                     $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
1480
-                } else
1481
-                    $expr = "!(1 & $is_arg)";
1506
+                } else {
1507
+                                    $expr = "!(1 & $is_arg)";
1508
+                }
1482 1509
                 break;
1483 1510
 
1484 1511
             case 'odd':
@@ -1486,8 +1513,9 @@  discard block
 block discarded – undo
1486 1513
                     $expr_end++;
1487 1514
                     $expr_arg = $tokens[$expr_end++];
1488 1515
                     $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
1489
-                } else
1490
-                    $expr = "(1 & $is_arg)";
1516
+                } else {
1517
+                                    $expr = "(1 & $is_arg)";
1518
+                }
1491 1519
                 break;
1492 1520
 
1493 1521
             case 'div':
@@ -1546,16 +1574,18 @@  discard block
 block discarded – undo
1546 1574
                     if (preg_match('~^\w+$~', $token)) {
1547 1575
                         $attr_name = $token;
1548 1576
                         $state = 1;
1549
-                    } else
1550
-                        $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__);
1577
+                    } else {
1578
+                                            $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__);
1579
+                    }
1551 1580
                     break;
1552 1581
 
1553 1582
                 case 1:
1554 1583
                     /* If the token is '=', then we go to state 2. */
1555 1584
                     if ($token == '=') {
1556 1585
                         $state = 2;
1557
-                    } else
1558
-                        $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
1586
+                    } else {
1587
+                                            $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
1588
+                    }
1559 1589
                     break;
1560 1590
 
1561 1591
                 case 2:
@@ -1579,8 +1609,9 @@  discard block
 block discarded – undo
1579 1609
 
1580 1610
                         $attrs[$attr_name] = $token;
1581 1611
                         $state = 0;
1582
-                    } else
1583
-                        $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__);
1612
+                    } else {
1613
+                                            $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__);
1614
+                    }
1584 1615
                     break;
1585 1616
             }
1586 1617
             $last_token = $token;
@@ -1642,32 +1673,27 @@  discard block
 block discarded – undo
1642 1673
                     $this->_parse_modifiers($return, $match[2]);
1643 1674
                 }
1644 1675
                 return $return;
1645
-            }
1646
-        elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1676
+            } elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1647 1677
                 // numerical constant
1648 1678
                 preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
1649 1679
                 if($match[2] != '') {
1650 1680
                     $this->_parse_modifiers($match[1], $match[2]);
1651 1681
                     return $match[1];
1652 1682
                 }
1653
-            }
1654
-        elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1683
+            } elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1655 1684
                 // single quoted text
1656 1685
                 preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
1657 1686
                 if($match[2] != '') {
1658 1687
                     $this->_parse_modifiers($match[1], $match[2]);
1659 1688
                     return $match[1];
1660 1689
                 }
1661
-            }
1662
-        elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1690
+            } elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1663 1691
                 // config var
1664 1692
                 return $this->_parse_conf_var($val);
1665
-            }
1666
-        elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1693
+            } elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
1667 1694
                 // section var
1668 1695
                 return $this->_parse_section_prop($val);
1669
-            }
1670
-        elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
1696
+            } elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
1671 1697
             // literal string
1672 1698
             return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"');
1673 1699
         }
@@ -1730,8 +1756,9 @@  discard block
 block discarded – undo
1730 1756
                         // just output the math operator to php
1731 1757
                         $_output .= $_math_var;
1732 1758
 
1733
-                        if(empty($_first_var))
1734
-                            $_first_var = $_complete_var;
1759
+                        if(empty($_first_var)) {
1760
+                                                    $_first_var = $_complete_var;
1761
+                        }
1735 1762
 
1736 1763
                         $_complete_var = "";
1737 1764
                     } else {
@@ -1740,8 +1767,9 @@  discard block
 block discarded – undo
1740 1767
                 }
1741 1768
             }
1742 1769
             if($_has_math) {
1743
-                if(!empty($_complete_var) || is_numeric($_complete_var))
1744
-                    $_output .= $this->_parse_var($_complete_var);
1770
+                if(!empty($_complete_var) || is_numeric($_complete_var)) {
1771
+                                    $_output .= $this->_parse_var($_complete_var);
1772
+                }
1745 1773
 
1746 1774
                 // get the modifiers working (only the last var from math + modifier is left)
1747 1775
                 $var_expr = $_complete_var;
@@ -1749,10 +1777,11 @@  discard block
 block discarded – undo
1749 1777
         }
1750 1778
 
1751 1779
         // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit)
1752
-        if(is_numeric(substr($var_expr, 0, 1)))
1753
-            $_var_ref = $var_expr;
1754
-        else
1755
-            $_var_ref = substr($var_expr, 1);
1780
+        if(is_numeric(substr($var_expr, 0, 1))) {
1781
+                    $_var_ref = $var_expr;
1782
+        } else {
1783
+                    $_var_ref = substr($var_expr, 1);
1784
+        }
1756 1785
         
1757 1786
         if(!$_has_math) {
1758 1787
             
@@ -1805,10 +1834,11 @@  discard block
 block discarded – undo
1805 1834
                         $_output .= "[\$this->_sections['$_var_section']['$_var_section_prop']]";
1806 1835
                     }
1807 1836
                 } else if (substr($_index, 0, 1) == '.') {
1808
-                    if (substr($_index, 1, 1) == '$')
1809
-                        $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]";
1810
-                    else
1811
-                        $_output .= "['" . substr($_index, 1) . "']";
1837
+                    if (substr($_index, 1, 1) == '$') {
1838
+                                            $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]";
1839
+                    } else {
1840
+                                            $_output .= "['" . substr($_index, 1) . "']";
1841
+                    }
1812 1842
                 } else if (substr($_index,0,2) == '->') {
1813 1843
                     if(substr($_index,2,2) == '__') {
1814 1844
                         $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
@@ -1949,10 +1979,11 @@  discard block
 block discarded – undo
1949 1979
                     $_modifier_args[0] = '@' . $_modifier_args[0];
1950 1980
                 }
1951 1981
             }
1952
-            if (count($_modifier_args) > 0)
1953
-                $_modifier_args = ', '.implode(', ', $_modifier_args);
1954
-            else
1955
-                $_modifier_args = '';
1982
+            if (count($_modifier_args) > 0) {
1983
+                            $_modifier_args = ', '.implode(', ', $_modifier_args);
1984
+            } else {
1985
+                            $_modifier_args = '';
1986
+            }
1956 1987
 
1957 1988
             if ($_map_array) {
1958 1989
                 $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))";
@@ -2266,8 +2297,12 @@  discard block
 block discarded – undo
2266 2297
     function _push_cacheable_state($type, $name) {
2267 2298
         $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
2268 2299
         if ($_cacheable
2269
-            || 0<$this->_cacheable_state++) return '';
2270
-        if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty'));
2300
+            || 0<$this->_cacheable_state++) {
2301
+            return '';
2302
+        }
2303
+        if (!isset($this->_cache_serial)) {
2304
+            $this->_cache_serial = md5(uniqid('Smarty'));
2305
+        }
2271 2306
         $_ret = 'if ($this->caching && !$this->_cache_including): echo \'{nocache:'
2272 2307
             . $this->_cache_serial . '#' . $this->_nocache_count
2273 2308
             . '}\'; endif;';
@@ -2284,7 +2319,9 @@  discard block
 block discarded – undo
2284 2319
     function _pop_cacheable_state($type, $name) {
2285 2320
         $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
2286 2321
         if ($_cacheable
2287
-            || --$this->_cacheable_state>0) return '';
2322
+            || --$this->_cacheable_state>0) {
2323
+            return '';
2324
+        }
2288 2325
         return 'if ($this->caching && !$this->_cache_including): echo \'{/nocache:'
2289 2326
             . $this->_cache_serial . '#' . ($this->_nocache_count++)
2290 2327
             . '}\'; endif;';
@@ -2350,11 +2387,13 @@  discard block
 block discarded – undo
2350 2387
  */
2351 2388
 function _smarty_sort_length($a, $b)
2352 2389
 {
2353
-    if($a == $b)
2354
-        return 0;
2390
+    if($a == $b) {
2391
+            return 0;
2392
+    }
2355 2393
 
2356
-    if(strlen($a) == strlen($b))
2357
-        return ($a > $b) ? -1 : 1;
2394
+    if(strlen($a) == strlen($b)) {
2395
+            return ($a > $b) ? -1 : 1;
2396
+    }
2358 2397
 
2359 2398
     return (strlen($a) > strlen($b)) ? -1 : 1;
2360 2399
 }
Please login to merge, or discard this patch.
htdocs/class/smarty/Config_File.class.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
     /**
44 44
      * Controls whether variables with the same name overwrite each other.
45 45
      */
46
-    var $overwrite        =    true;
46
+    var $overwrite = true;
47 47
 
48 48
     /**
49 49
      * Controls whether config values of on/true/yes and off/false/no get
50 50
      * converted to boolean values automatically.
51 51
      */
52
-    var $booleanize        =    true;
52
+    var $booleanize = true;
53 53
 
54 54
     /**
55 55
      * Controls whether hidden config sections/vars are read from the file.
56 56
      */
57
-    var $read_hidden     =    true;
57
+    var $read_hidden = true;
58 58
 
59 59
     /**
60 60
      * Controls whether or not to fix mac or dos formatted newlines.
61 61
      * If set to true, \r or \r\n will be changed to \n.
62 62
      */
63
-    var $fix_newlines =    true;
63
+    var $fix_newlines = true;
64 64
     /**#@-*/
65 65
 
66 66
     /** @access private */
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                 $this->_trigger_error_msg("Bad config file path '$config_path'");
93 93
                 return;
94 94
             }
95
-            if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
95
+            if (substr($config_path, -1) != DIRECTORY_SEPARATOR) {
96 96
                 $config_path .= DIRECTORY_SEPARATOR;
97 97
             }
98 98
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $this->_trigger_error_msg('Empty config file name');
116 116
             return;
117 117
         } else {
118
-            $file_name = $this->_config_path . $file_name;
118
+            $file_name = $this->_config_path.$file_name;
119 119
             if (!isset($this->_config_data[$file_name]))
120 120
                 $this->load_file($file_name, false);
121 121
         }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             if (empty($section_name)) {
125 125
                 return $this->_config_data[$file_name]["vars"][$var_name];
126 126
             } else {
127
-                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
127
+                if (isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
128 128
                     return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
129 129
                 else
130 130
                     return array();
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             if (empty($section_name)) {
134 134
                 return (array)$this->_config_data[$file_name]["vars"];
135 135
             } else {
136
-                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
136
+                if (isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
137 137
                     return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
138 138
                 else
139 139
                     return array();
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     function get_section_names($file_name)
177 177
     {
178
-        $file_name = $this->_config_path . $file_name;
178
+        $file_name = $this->_config_path.$file_name;
179 179
         if (!isset($this->_config_data[$file_name])) {
180 180
             $this->_trigger_error_msg("Unknown config file '$file_name'");
181 181
             return;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     function load_file($file_name, $prepend_path = true)
234 234
     {
235 235
         if ($prepend_path && $this->_config_path != "")
236
-            $config_file = $this->_config_path . $file_name;
236
+            $config_file = $this->_config_path.$file_name;
237 237
         else
238 238
             $config_file = $file_name;
239 239
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      */
271 271
     function parse_contents($contents)
272 272
     {
273
-        if($this->fix_newlines) {
273
+        if ($this->fix_newlines) {
274 274
             // fix mac/dos formatted newlines
275 275
             $contents = preg_replace('!\r\n?!', "\n", $contents);
276 276
         }
@@ -280,16 +280,16 @@  discard block
 block discarded – undo
280 280
         $config_data['vars'] = array();
281 281
 
282 282
         /* reference to fill with data */
283
-        $vars =& $config_data['vars'];
283
+        $vars = & $config_data['vars'];
284 284
 
285 285
         /* parse file line by line */
286 286
         preg_match_all('!^.*\r?\n?!m', $contents, $match);
287 287
         $lines = $match[0];
288
-        for ($i=0, $count=count($lines); $i<$count; $i++) {
288
+        for ($i = 0, $count = count($lines); $i < $count; $i++) {
289 289
             $line = $lines[$i];
290 290
             if (empty($line)) continue;
291 291
 
292
-            if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
292
+            if (substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match)) {
293 293
                 /* section found */
294 294
                 if (substr($match[1], 0, 1) == '.') {
295 295
                     /* hidden section */
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 }
307 307
                 if (!isset($config_data['sections'][$section_name]))
308 308
                     $config_data['sections'][$section_name] = array('vars' => array());
309
-                $vars =& $config_data['sections'][$section_name]['vars'];
309
+                $vars = & $config_data['sections'][$section_name]['vars'];
310 310
                 continue;
311 311
             }
312 312
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                     /* handle multiline-value */
318 318
                     $lines[$i] = substr($match[2], 3);
319 319
                     $var_value = '';
320
-                    while ($i<$count) {
320
+                    while ($i < $count) {
321 321
                         if (($pos = strpos($lines[$i], '"""')) === false) {
322 322
                             $var_value .= $lines[$i++];
323 323
                         } else {
Please login to merge, or discard this patch.
Braces   +50 added lines, -38 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function __construct($config_path = NULL)
77 77
     {
78
-        if (isset($config_path))
79
-            $this->set_path($config_path);
78
+        if (isset($config_path)) {
79
+                    $this->set_path($config_path);
80
+        }
80 81
     }
81 82
 
82 83
 
@@ -116,27 +117,30 @@  discard block
 block discarded – undo
116 117
             return;
117 118
         } else {
118 119
             $file_name = $this->_config_path . $file_name;
119
-            if (!isset($this->_config_data[$file_name]))
120
-                $this->load_file($file_name, false);
120
+            if (!isset($this->_config_data[$file_name])) {
121
+                            $this->load_file($file_name, false);
122
+            }
121 123
         }
122 124
 
123 125
         if (!empty($var_name)) {
124 126
             if (empty($section_name)) {
125 127
                 return $this->_config_data[$file_name]["vars"][$var_name];
126 128
             } else {
127
-                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
128
-                    return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
129
-                else
130
-                    return array();
129
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name])) {
130
+                                    return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
131
+                } else {
132
+                                    return array();
133
+                }
131 134
             }
132 135
         } else {
133 136
             if (empty($section_name)) {
134 137
                 return (array)$this->_config_data[$file_name]["vars"];
135 138
             } else {
136
-                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
137
-                    return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
138
-                else
139
-                    return array();
139
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"])) {
140
+                                    return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
141
+                } else {
142
+                                    return array();
143
+                }
140 144
             }
141 145
         }
142 146
     }
@@ -202,10 +206,11 @@  discard block
 block discarded – undo
202 206
             return;
203 207
         }
204 208
 
205
-        if (empty($section))
206
-            return array_keys($this->_config_data[$file_name]["vars"]);
207
-        else
208
-            return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
209
+        if (empty($section)) {
210
+                    return array_keys($this->_config_data[$file_name]["vars"]);
211
+        } else {
212
+                    return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
213
+        }
209 214
     }
210 215
 
211 216
 
@@ -216,10 +221,11 @@  discard block
 block discarded – undo
216 221
      */
217 222
     function clear($file_name = NULL)
218 223
     {
219
-        if ($file_name === NULL)
220
-            $this->_config_data = array();
221
-        else if (isset($this->_config_data[$file_name]))
222
-            $this->_config_data[$file_name] = array();
224
+        if ($file_name === NULL) {
225
+                    $this->_config_data = array();
226
+        } else if (isset($this->_config_data[$file_name])) {
227
+                    $this->_config_data[$file_name] = array();
228
+        }
223 229
     }
224 230
 
225 231
 
@@ -232,10 +238,11 @@  discard block
 block discarded – undo
232 238
      */
233 239
     function load_file($file_name, $prepend_path = true)
234 240
     {
235
-        if ($prepend_path && $this->_config_path != "")
236
-            $config_file = $this->_config_path . $file_name;
237
-        else
238
-            $config_file = $file_name;
241
+        if ($prepend_path && $this->_config_path != "") {
242
+                    $config_file = $this->_config_path . $file_name;
243
+        } else {
244
+                    $config_file = $file_name;
245
+        }
239 246
 
240 247
         ini_set('track_errors', true);
241 248
         $fp = @fopen($config_file, "r");
@@ -287,7 +294,9 @@  discard block
 block discarded – undo
287 294
         $lines = $match[0];
288 295
         for ($i=0, $count=count($lines); $i<$count; $i++) {
289 296
             $line = $lines[$i];
290
-            if (empty($line)) continue;
297
+            if (empty($line)) {
298
+                continue;
299
+            }
291 300
 
292 301
             if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
293 302
                 /* section found */
@@ -304,8 +313,9 @@  discard block
 block discarded – undo
304 313
                 } else {                    
305 314
                     $section_name = $match[1];
306 315
                 }
307
-                if (!isset($config_data['sections'][$section_name]))
308
-                    $config_data['sections'][$section_name] = array('vars' => array());
316
+                if (!isset($config_data['sections'][$section_name])) {
317
+                                    $config_data['sections'][$section_name] = array('vars' => array());
318
+                }
309 319
                 $vars =& $config_data['sections'][$section_name]['vars'];
310 320
                 continue;
311 321
             }
@@ -352,10 +362,11 @@  discard block
 block discarded – undo
352 362
     function _set_config_var(&$container, $var_name, $var_value, $booleanize)
353 363
     {
354 364
         if (substr($var_name, 0, 1) == '.') {
355
-            if (!$this->read_hidden)
356
-                return;
357
-            else
358
-                $var_name = substr($var_name, 1);
365
+            if (!$this->read_hidden) {
366
+                            return;
367
+            } else {
368
+                            $var_name = substr($var_name, 1);
369
+            }
359 370
         }
360 371
 
361 372
         if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) {
@@ -364,15 +375,16 @@  discard block
 block discarded – undo
364 375
         }
365 376
 
366 377
         if ($booleanize) {
367
-            if (preg_match("/^(on|true|yes)$/i", $var_value))
368
-                $var_value = true;
369
-            else if (preg_match("/^(off|false|no)$/i", $var_value))
370
-                $var_value = false;
378
+            if (preg_match("/^(on|true|yes)$/i", $var_value)) {
379
+                            $var_value = true;
380
+            } else if (preg_match("/^(off|false|no)$/i", $var_value)) {
381
+                            $var_value = false;
382
+            }
371 383
         }
372 384
 
373
-        if (!isset($container[$var_name]) || $this->overwrite)
374
-            $container[$var_name] = $var_value;
375
-        else {
385
+        if (!isset($container[$var_name]) || $this->overwrite) {
386
+                    $container[$var_name] = $var_value;
387
+        } else {
376 388
             settype($container[$var_name], 'array');
377 389
             $container[$var_name][] = $var_value;
378 390
         }
Please login to merge, or discard this patch.
htdocs/class/smarty/xoops_plugins/compiler.xoAdminIcons.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@
 block discarded – undo
29 29
         $icons = 'default';
30 30
     }
31 31
 
32
-    if (file_exists($xoops->path('modules/system/images/icons/' . $icons . '/index.html'))) {
33
-        $url = $xoops->url('modules/system/images/icons/' . $icons . '/' . $argStr);
32
+    if (file_exists($xoops->path('modules/system/images/icons/'.$icons.'/index.html'))) {
33
+        $url = $xoops->url('modules/system/images/icons/'.$icons.'/'.$argStr);
34 34
     } else {
35
-        if (file_exists($xoops->path('modules/system/images/icons/default/' . $argStr))) {
36
-            $url = $xoops->url('modules/system/images/icons/default/' . $argStr);
35
+        if (file_exists($xoops->path('modules/system/images/icons/default/'.$argStr))) {
36
+            $url = $xoops->url('modules/system/images/icons/default/'.$argStr);
37 37
         } else {
38 38
             $url = $xoops->url('modules/system/images/icons/default/xoops/xoops.png');
39 39
         }
40 40
     }
41 41
 
42
-    return "\necho '" . addslashes($url) . "';";
42
+    return "\necho '".addslashes($url)."';";
43 43
 }
Please login to merge, or discard this patch.
htdocs/class/smarty/xoops_plugins/compiler.xoModuleIcons16.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@
 block discarded – undo
28 28
     //    if ( $icons == '' ) $icons = 'default';
29 29
 
30 30
     if (file_exists($xoops->path('Frameworks/moduleclasses/icons/16/index.html'))) {
31
-        $url = $xoops->url('Frameworks/moduleclasses/icons/16/' . $argStr);
31
+        $url = $xoops->url('Frameworks/moduleclasses/icons/16/'.$argStr);
32 32
     } else {
33
-        if (file_exists($xoops->path('modules/system/images/icons/default/' . $argStr))) {
34
-            $url = $xoops->url('modules/system/images/icons/default/' . $argStr);
33
+        if (file_exists($xoops->path('modules/system/images/icons/default/'.$argStr))) {
34
+            $url = $xoops->url('modules/system/images/icons/default/'.$argStr);
35 35
         } else {
36 36
             $url = $xoops->url('modules/system/images/icons/default/xoops/xoops.png');
37 37
         }
38 38
     }
39 39
 
40
-    return "\necho '" . addslashes($url) . "';";
40
+    return "\necho '".addslashes($url)."';";
41 41
 }
Please login to merge, or discard this patch.
htdocs/class/smarty/xoops_plugins/compiler.xoAdminNav.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
         $icons = 'default';
30 30
     }
31 31
 
32
-    if (file_exists($xoops->path('modules/system/images/breadcrumb/' . $icons . '/index.html'))) {
33
-        $url = $xoops->url('modules/system/images/breadcrumb/' . $icons . '/' . $argStr);
32
+    if (file_exists($xoops->path('modules/system/images/breadcrumb/'.$icons.'/index.html'))) {
33
+        $url = $xoops->url('modules/system/images/breadcrumb/'.$icons.'/'.$argStr);
34 34
     } else {
35
-        if (file_exists($xoops->path('modules/system/images/breadcrumb/default/' . $argStr))) {
36
-            $url = $xoops->url('modules/system/images/icons/default/' . $argStr);
35
+        if (file_exists($xoops->path('modules/system/images/breadcrumb/default/'.$argStr))) {
36
+            $url = $xoops->url('modules/system/images/icons/default/'.$argStr);
37 37
         }
38 38
     }
39 39
 
40
-    return "\necho '" . addslashes($url) . "';";
40
+    return "\necho '".addslashes($url)."';";
41 41
 }
Please login to merge, or discard this patch.