Changeset 3874:ab8368569446 for inc/public/lib.tpl.context.php
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/public/lib.tpl.context.php
r3832 r3874 12 12 class context 13 13 { 14 public $stack = array();14 public $stack = []; 15 15 16 16 public function __set($name, $var) … … 105 105 return self::global_filters( 106 106 $str, 107 array(0 => null,107 [0 => null, 108 108 'encode_xml' => $encode_xml, 109 109 'remove_html' => $remove_html, … … 112 112 'upper_case' => ($upper_case == 1 ? 1 : 0), 113 113 'capitalize' => ($upper_case == 2 ? 1 : 0), 114 'encode_url' => $encode_url ),114 'encode_url' => $encode_url], 115 115 $tag); 116 116 } … … 149 149 public static function global_filters($str, $args, $tag = '') 150 150 { 151 $filters = array(151 $filters = [ 152 152 'strip_tags', // Removes HTML tags (mono line) 153 153 'remove_html', // Removes HTML tags … … 156 156 'lower_case', 'capitalize', 'upper_case', // Case transformations 157 157 'encode_url' // URL encode (as for insert in query string) 158 );158 ]; 159 159 160 160 $args[0] = &$str; … … 209 209 public static function strip_tags($str) 210 210 { 211 return trim(preg_replace('/ {2,}/', ' ', str_replace( array("\r", "\n", "\t"), ' ', html::clean($str))));211 return trim(preg_replace('/ {2,}/', ' ', str_replace(["\r", "\n", "\t"], ' ', html::clean($str)))); 212 212 } 213 213 … … 336 336 public static function robotsPolicy($base, $over) 337 337 { 338 $pol = array('INDEX' => 'INDEX', 'FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE');338 $pol = ['INDEX' => 'INDEX', 'FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE']; 339 339 $base = array_flip(preg_split('/\s*,\s*/', $base)); 340 340 $over = array_flip(preg_split('/\s*,\s*/', $over)); … … 359 359 public static function getSmilies($blog) 360 360 { 361 $path = array();361 $path = []; 362 362 if (isset($GLOBALS['__theme'])) { 363 363 $path[] = $GLOBALS['__theme']; … … 370 370 $base_url = $blog->settings->system->themes_url . '/%s/smilies/'; 371 371 372 $res = array();372 $res = []; 373 373 374 374 foreach ($path as $t) { … … 385 385 $def = file($f); 386 386 387 $res = array();387 $res = []; 388 388 foreach ($def as $v) { 389 389 $v = trim($v); … … 448 448 # 449 449 $index = 0; 450 $tokens = array();450 $tokens = []; 451 451 452 452 $match = '(?s:<!(?:--.*?--\s*)+>)|' . # comment … … 459 459 foreach ($parts as $part) { 460 460 if (++$index % 2 && $part != '') { 461 $tokens[] = array('text', $part);461 $tokens[] = ['text', $part]; 462 462 } else { 463 $tokens[] = array('tag', $part);463 $tokens[] = ['tag', $part]; 464 464 } 465 465
Note: See TracChangeset
for help on using the changeset viewer.