diff --git a/CHANGELOG b/CHANGELOG index 272f839fb..c3e280963 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,17 @@ +Hubzilla 3.8.3 (2018-11-05) + - Do not count likes in forum notifications if likes notifications are disabled + - Fix typo in spanish translation which broke javascript + - Improve linkinfo charset handling and image detection + - Fix wrong image resize for some external images + - Move blueimp upload lib to composer and update to version 9.25 + - Remove primary/clone counts from admin summary until we have a mechanism to update the fixed counts + - Fix html2markdown() and re-enable previously failing tests + - Improve look of oembed content for Hubzilla links + - Fix forum notifications count not correct + - Fix gallery addon which broke mod apps in some situations + - Fix wiki_list widget not working on every page respectively level + + Hubzilla 3.8.2 (2018-10-29) - Merge unmerged changes from dev into master - Fix issues with forum handling in mod network and ping diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 6edced9b5..8ccdaf4f5 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -109,11 +109,9 @@ class Admin extends \Zotlabs\Web\Controller { // available channels, primary and clones $channels = array(); - $r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0 and channel_system = 0"); + $r = q("SELECT COUNT(*) AS total FROM channel WHERE channel_removed = 0 and channel_system = 0"); if ($r) { $channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']); - $channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']); - $channels['clones'] = array('label' => t('Clones'), 'val' => $r[0]['clones']); } // We can do better, but this is a quick queue status diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index a0ad17e68..7c7dc0e88 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -228,8 +228,13 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; + + // Check codepage in HTTP headers or HTML if not exist + $cp = (preg_match('/Content-Type: text\/html; charset=(.+)\r\n/i', $header, $o) ? $o[1] : ''); + if(empty($cp)) + $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); - $body = mb_convert_encoding($body, 'UTF-8', (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'UTF-8')); + $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); $doc = new \DOMDocument(); @@ -265,20 +270,43 @@ class Linkinfo extends \Zotlabs\Web\Controller { $attr["content"] = html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"); switch (strtolower($attr["name"])) { - case 'generator': - $siteinfo['generator'] = $attr['content']; - break; case "fulltitle": - $siteinfo["title"] = $attr["content"]; + $siteinfo["title"] = trim($attr["content"]); break; case "description": - $siteinfo["text"] = $attr["content"]; + $siteinfo["text"] = trim($attr["content"]); + break; + case "thumbnail": + $siteinfo["image"] = $attr["content"]; + break; + case "twitter:image": + $siteinfo["image"] = $attr["content"]; + break; + case "twitter:image:src": + $siteinfo["image"] = $attr["content"]; + break; + case "twitter:card": + if (($siteinfo["type"] == "") || ($attr["content"] == "photo")) { + $siteinfo["type"] = $attr["content"]; + } + break; + case "twitter:description": + $siteinfo["text"] = trim($attr["content"]); + break; + case "twitter:title": + $siteinfo["title"] = trim($attr["content"]); break; case "dc.title": - $siteinfo["title"] = $attr["content"]; + $siteinfo["title"] = trim($attr["content"]); break; case "dc.description": - $siteinfo["text"] = $attr["content"]; + $siteinfo["text"] = trim($attr["content"]); + break; + case "keywords": + $keywords = explode(",", $attr["content"]); + break; + case "news_keywords": + $keywords = explode(",", $attr["content"]); break; } } diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 294e11c52..b93faa612 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -258,6 +258,10 @@ class Network extends \Zotlabs\Web\Controller { } elseif($pf && $unseen && $nouveau) { + $vnotify = get_pconfig(local_channel(), 'system', 'vnotify'); + if(! ($vnotify & VNOTIFY_LIKE)) + $likes_sql = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') "; + // This is for nouveau view public forum cid queries (if a forum notification is clicked) $p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'", intval(local_channel()), @@ -269,7 +273,7 @@ class Network extends \Zotlabs\Web\Controller { if($p_str) $p_sql = " OR item.parent IN ( $p_str ) "; - $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 "; + $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 $likes_sql "; } else { // This is for threaded view cid queries (e.g. if a forum is selected from the forum filter) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index f97f31ff7..78bfb1f09 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -612,9 +612,9 @@ class Photos extends \Zotlabs\Web\Controller { nav_set_selected('Photos'); - $o = ' - - '; + $o = ' + + '; $o .= "'; } elseif ($encode === 'javascript_charcode') { $string = '' . $text . ''; - - for ($x = 0, $y = strlen($string); $x < $y; $x ++) { + for ($x = 0, $y = strlen($string); $x < $y; $x++) { $ord[] = ord($string[ $x ]); } - $_ret = "\n"; - return $_ret; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[ 2 ])) { trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.", E_USER_WARNING); - return; } $address_encode = ''; - for ($x = 0, $_length = strlen($address); $x < $_length; $x ++) { + for ($x = 0, $_length = strlen($address); $x < $_length; $x++) { if (preg_match('!\w!' . Smarty::$_UTF8_MODIFIER, $address[ $x ])) { $address_encode .= '%' . bin2hex($address[ $x ]); } else { @@ -139,12 +125,10 @@ function smarty_function_mailto($params) } } $text_encode = ''; - for ($x = 0, $_length = strlen($text); $x < $_length; $x ++) { + for ($x = 0, $_length = strlen($text); $x < $_length; $x++) { $text_encode .= '&#x' . bin2hex($text[ $x ]) . ';'; } - $mailto = "mailto:"; - return '' . $text_encode . ''; } else { // no encoding diff --git a/vendor/smarty/smarty/libs/plugins/function.math.php b/vendor/smarty/smarty/libs/plugins/function.math.php index 396ad085e..7348d9649 100644 --- a/vendor/smarty/smarty/libs/plugins/function.math.php +++ b/vendor/smarty/smarty/libs/plugins/function.math.php @@ -6,16 +6,15 @@ * @package Smarty * @subpackage PluginsFunction */ - /** * Smarty {math} function plugin * Type: function * Name: math * Purpose: handle math computations in template * - * @link http://www.smarty.net/manual/en/language.function.math.php {math} + * @link http://www.smarty.net/manual/en/language.function.math.php {math} * (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * * @param array $params parameters * @param Smarty_Internal_Template $template template object @@ -25,66 +24,71 @@ function smarty_function_math($params, $template) { static $_allowed_funcs = - array('int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, - 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, 'rand' => true, - 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true); + array( + 'int' => true, + 'abs' => true, + 'ceil' => true, + 'cos' => true, + 'exp' => true, + 'floor' => true, + 'log' => true, + 'log10' => true, + 'max' => true, + 'min' => true, + 'pi' => true, + 'pow' => true, + 'rand' => true, + 'round' => true, + 'sin' => true, + 'sqrt' => true, + 'srand' => true, + 'tan' => true + ); // be sure equation parameter is present if (empty($params[ 'equation' ])) { trigger_error("math: missing equation parameter", E_USER_WARNING); - return; } - $equation = $params[ 'equation' ]; - // make sure parenthesis are balanced if (substr_count($equation, '(') !== substr_count($equation, ')')) { trigger_error("math: unbalanced parenthesis", E_USER_WARNING); - return; } - // disallow backticks if (strpos($equation, '`') !== false) { trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); - return; } - // also disallow dollar signs if (strpos($equation, '$') !== false) { trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); - return; } - foreach ($params as $key => $val) { if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { // make sure value is not empty if (strlen($val) === 0) { trigger_error("math: parameter '{$key}' is empty", E_USER_WARNING); - return; } if (!is_numeric($val)) { trigger_error("math: parameter '{$key}' is not numeric", E_USER_WARNING); - return; } } } - // match all vars in equation, make sure all are passed preg_match_all('!(?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)!', $equation, $match); - foreach ($match[ 1 ] as $curr_var) { if ($curr_var && !isset($params[ $curr_var ]) && !isset($_allowed_funcs[ $curr_var ])) { - trigger_error("math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'", E_USER_WARNING); - + trigger_error( + "math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'", + E_USER_WARNING + ); return; } } - foreach ($params as $key => $val) { if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); @@ -92,7 +96,6 @@ function smarty_function_math($params, $template) } $smarty_math_result = null; eval("\$smarty_math_result = " . $equation . ";"); - if (empty($params[ 'format' ])) { if (empty($params[ 'assign' ])) { return $smarty_math_result; diff --git a/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php b/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php index e354977b0..c5fc400a6 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty capitalize modifier plugin * Type: modifier @@ -29,50 +28,75 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals $upper_string = mb_convert_case($string, MB_CASE_TITLE, Smarty::$_CHARSET); } else { // uppercase word breaks - $upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, - 'smarty_mod_cap_mbconvert_cb', $string); + $upper_string = preg_replace_callback( + "!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_mbconvert_cb', + $string + ); } // check uc_digits case if (!$uc_digits) { - if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, - PREG_OFFSET_CAPTURE)) { + if (preg_match_all( + "!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, + $string, + $matches, + PREG_OFFSET_CAPTURE + ) + ) { foreach ($matches[ 1 ] as $match) { $upper_string = - substr_replace($upper_string, mb_strtolower($match[ 0 ], Smarty::$_CHARSET), $match[ 1 ], - strlen($match[ 0 ])); + substr_replace( + $upper_string, + mb_strtolower($match[ 0 ], Smarty::$_CHARSET), + $match[ 1 ], + strlen($match[ 0 ]) + ); } } } $upper_string = - preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_mbconvert2_cb', - $upper_string); + preg_replace_callback( + "!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_mbconvert2_cb', + $upper_string + ); return $upper_string; } - // lowercase first if ($lc_rest) { $string = strtolower($string); } // uppercase (including hyphenated words) $upper_string = - preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst_cb', - $string); + preg_replace_callback( + "!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_ucfirst_cb', + $string + ); // check uc_digits case if (!$uc_digits) { - if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, - PREG_OFFSET_CAPTURE)) { + if (preg_match_all( + "!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, + $string, + $matches, + PREG_OFFSET_CAPTURE + ) + ) { foreach ($matches[ 1 ] as $match) { $upper_string = substr_replace($upper_string, strtolower($match[ 0 ]), $match[ 1 ], strlen($match[ 0 ])); } } } - $upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, 'smarty_mod_cap_ucfirst2_cb', - $upper_string); + $upper_string = preg_replace_callback( + "!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, + 'smarty_mod_cap_ucfirst2_cb', + $upper_string + ); return $upper_string; } -/* +/** * * Bug: create_function() use exhausts memory when used in long loops * Fix: use declared functions for callbacks instead of using create_function() @@ -89,6 +113,7 @@ function smarty_mod_cap_mbconvert_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } + /** * @param $matches * @@ -98,6 +123,7 @@ function smarty_mod_cap_mbconvert2_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } + /** * @param $matches * @@ -107,6 +133,7 @@ function smarty_mod_cap_ucfirst_cb($matches) { return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ])); } + /** * @param $matches * diff --git a/vendor/smarty/smarty/libs/plugins/modifier.date_format.php b/vendor/smarty/smarty/libs/plugins/modifier.date_format.php index b45b2d4b8..23b69430b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.date_format.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.date_format.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty date_format modifier plugin * Type: modifier @@ -38,7 +37,7 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' static $is_loaded = false; if (!$is_loaded) { if (!is_callable('smarty_make_timestamp')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'; } $is_loaded = true; } @@ -51,20 +50,24 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' } if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) { if (Smarty::$_IS_WINDOWS) { - $_win_from = array('%D', - '%h', - '%n', - '%r', - '%R', - '%t', - '%T'); - $_win_to = array('%m/%d/%y', - '%b', - "\n", - '%I:%M:%S %p', - '%H:%M', - "\t", - '%H:%M:%S'); + $_win_from = array( + '%D', + '%h', + '%n', + '%r', + '%R', + '%t', + '%T' + ); + $_win_to = array( + '%m/%d/%y', + '%b', + "\n", + '%I:%M:%S %p', + '%H:%M', + "\t", + '%H:%M:%S' + ); if (strpos($format, '%e') !== false) { $_win_from[] = '%e'; $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); @@ -75,7 +78,6 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' } $format = str_replace($_win_from, $_win_to, $format); } - return strftime($format, $timestamp); } else { return date($format, $timestamp); diff --git a/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php b/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php index 2bd112154..78397d017 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.debug_print_var.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage Debug */ - /** * Smarty debug_print_var modifier plugin * Type: modifier @@ -26,7 +25,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = { $_replace = array("\n" => '\n', "\r" => '\r', "\t" => '\t'); switch (gettype($var)) { - case 'array' : + case 'array': $results = 'Array (' . count($var) . ')'; if ($depth === $max) { break; @@ -34,12 +33,11 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = foreach ($var as $curr_key => $curr_val) { $results .= '
' . str_repeat(' ', $depth * 2) . '' . strtr($curr_key, $_replace) . ' => ' . - smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects); - $depth --; + smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; } break; - - case 'object' : + case 'object': $object_vars = get_object_vars($var); $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; if (in_array($var, $objects)) { @@ -52,14 +50,13 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $objects[] = $var; foreach ($object_vars as $curr_key => $curr_val) { $results .= '
' . str_repeat(' ', $depth * 2) . ' ->' . strtr($curr_key, $_replace) . - ' = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++ $depth, $objects); - $depth --; + ' = ' . smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; } break; - - case 'boolean' : - case 'NULL' : - case 'resource' : + case 'boolean': + case 'NULL': + case 'resource': if (true === $var) { $results = 'true'; } elseif (false === $var) { @@ -67,17 +64,15 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = } elseif (null === $var) { $results = 'null'; } else { - $results = htmlspecialchars((string) $var); + $results = htmlspecialchars((string)$var); } $results = '' . $results . ''; break; - - case 'integer' : - case 'float' : - $results = htmlspecialchars((string) $var); + case 'integer': + case 'float': + $results = htmlspecialchars((string)$var); break; - - case 'string' : + case 'string': $results = strtr($var, $_replace); if (Smarty::$_MBSTRING) { if (mb_strlen($var, Smarty::$_CHARSET) > $length) { @@ -88,13 +83,11 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $results = substr($var, 0, $length - 3) . '...'; } } - $results = htmlspecialchars('"' . $results . '"', ENT_QUOTES, Smarty::$_CHARSET); break; - - case 'unknown type' : - default : - $results = strtr((string) $var, $_replace); + case 'unknown type': + default: + $results = strtr((string)$var, $_replace); if (Smarty::$_MBSTRING) { if (mb_strlen($results, Smarty::$_CHARSET) > $length) { $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...'; @@ -104,9 +97,7 @@ function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = $results = substr($results, 0, $length - 3) . '...'; } } - $results = htmlspecialchars($results, ENT_QUOTES, Smarty::$_CHARSET); } - return $results; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.escape.php b/vendor/smarty/smarty/libs/plugins/modifier.escape.php index 1ae87a7aa..150901c7c 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.escape.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty escape modifier plugin * Type: modifier @@ -30,11 +29,9 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - if (!$char_set) { $char_set = Smarty::$_CHARSET; } - switch ($esc_type) { case 'html': if ($_double_encode) { @@ -48,14 +45,21 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // php <5.2.3 - prevent double encoding $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); - $string = str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + $string = str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - + // no break case 'htmlall': if (Smarty::$_MBSTRING) { // mb_convert_encoding ignores htmlspecialchars() @@ -71,18 +75,23 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlspecialchars($string, ENT_QUOTES, $char_set); $string = - str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - // htmlentities() won't convert everything, so use mb_convert_encoding return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set); } - // no MBString fallback if ($_double_encode) { return htmlentities($string, ENT_QUOTES, $char_set, $double_encode); @@ -92,41 +101,43 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ } else { $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); $string = htmlentities($string, ENT_QUOTES, $char_set); - $string = str_replace(array('%%%SMARTY_START%%%', - '%%%SMARTY_END%%%'), array('&', - ';'), $string); - + $string = str_replace( + array( + '%%%SMARTY_START%%%', + '%%%SMARTY_END%%%' + ), + array( + '&', + ';' + ), + $string + ); return $string; } } - + // no break case 'url': return rawurlencode($string); - case 'urlpathinfo': return str_replace('%2F', '/', rawurlencode($string)); - case 'quotes': // escape unescaped single quotes return preg_replace("%(? '\\\\', - "'" => "\\'", - '"' => '\\"', - "\r" => '\\r', - "\n" => '\\n', - ' '<\/')); - + return strtr( + $string, + array( + '\\' => '\\\\', + "'" => "\\'", + '"' => '\\"', + "\r" => '\\r', + "\n" => '\\n', + ' '<\/' + ) + ); case 'mail': if (Smarty::$_MBSTRING) { if (!$is_loaded_2) { if (!is_callable('smarty_mb_str_replace')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'; } $is_loaded_2 = true; } - return smarty_mb_str_replace(array('@', - '.'), array(' [AT] ', - ' [DOT] '), $string); + return smarty_mb_str_replace( + array( + '@', + '.' + ), + array( + ' [AT] ', + ' [DOT] ' + ), + $string + ); } // no MBString fallback - return str_replace(array('@', - '.'), array(' [AT] ', - ' [DOT] '), $string); - + return str_replace( + array( + '@', + '.' + ), + array( + ' [AT] ', + ' [DOT] ' + ), + $string + ); case 'nonstd': // escape non-standard chars, such as ms document quotes $return = ''; if (Smarty::$_MBSTRING) { if (!$is_loaded_1) { if (!is_callable('smarty_mb_to_unicode')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_unicode.php'; } $is_loaded_1 = true; } @@ -212,12 +236,10 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= chr($unicode); } } - return $return; } - $_length = strlen($string); - for ($_i = 0; $_i < $_length; $_i ++) { + for ($_i = 0; $_i < $_length; $_i++) { $_ord = ord(substr($string, $_i, 1)); // non-standard char, escape it if ($_ord >= 126) { @@ -226,9 +248,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ $return .= substr($string, $_i, 1); } } - return $return; - default: return $string; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php b/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php index 93c6241ec..1cd625b64 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.mb_wordwrap.php @@ -11,13 +11,12 @@ * Name: mb_wordwrap * Purpose: Wrap a string to a given number of characters * - * @link http://php.net/manual/en/function.wordwrap.php for similarity * - * @param string $str the string to wrap - * @param int $width the width of the output - * @param string $break the character used to break the line - * @param boolean $cut ignored parameter, just for the sake of + * @param string $str the string to wrap + * @param int $width the width of the output + * @param string $break the character used to break the line + * @param boolean $cut ignored parameter, just for the sake of * * @return string wrapped string * @author Rodney Rehm @@ -30,30 +29,28 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa $t = ''; $_previous = false; $_space = false; - foreach ($tokens as $_token) { $token_length = mb_strlen($_token, Smarty::$_CHARSET); $_tokens = array($_token); if ($token_length > $width) { if ($cut) { - $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, - $_token, - -1, - PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE); + $_tokens = preg_split( + '!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, + $_token, + -1, + PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE + ); } } - foreach ($_tokens as $token) { $_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token); $token_length = mb_strlen($token, Smarty::$_CHARSET); $length += $token_length; - if ($length > $width) { // remove space before inserted break if ($_previous) { $t = mb_substr($t, 0, -1, Smarty::$_CHARSET); } - if (!$_space) { // add the break before the token if (!empty($t)) { @@ -61,7 +58,7 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa } $length = $token_length; } - } else if ($token === "\n") { + } elseif ($token === "\n") { // hard break must reset counters $length = 0; } @@ -70,6 +67,5 @@ function smarty_modifier_mb_wordwrap($str, $width = 75, $break = "\n", $cut = fa $t .= $token; } } - return $t; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php b/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php index 479aba875..7eb550695 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.regex_replace.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty regex_replace modifier plugin * Type: modifier * Name: regex_replace * Purpose: regular expression search/replace * - * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php + * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php * regex_replace (Smarty online manual) - * @author Monte Ohrt + * @author Monte Ohrt * * @param string $string input string * @param string|array $search regular expression(s) to search for @@ -23,7 +22,7 @@ * * @return string */ -function smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1) +function smarty_modifier_regex_replace($string, $search, $replace, $limit = -1) { if (is_array($search)) { foreach ($search as $idx => $s) { @@ -32,7 +31,6 @@ function smarty_modifier_regex_replace($string, $search, $replace, $limit = - 1) } else { $search = _smarty_regex_replace_check($search); } - return preg_replace($search, $replace, $string, $limit); } @@ -51,8 +49,7 @@ function _smarty_regex_replace_check($search) } // remove eval-modifier from $search if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[ 1 ], 'e') !== false)) { - $search = substr($search, 0, - strlen($match[ 1 ])) . preg_replace('![e\s]+!', '', $match[ 1 ]); + $search = substr($search, 0, -strlen($match[ 1 ])) . preg_replace('![e\s]+!', '', $match[ 1 ]); } - return $search; } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.replace.php b/vendor/smarty/smarty/libs/plugins/modifier.replace.php index a1b043b64..a98f5a4a6 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.replace.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.replace.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty replace modifier plugin * Type: modifier @@ -28,12 +27,11 @@ function smarty_modifier_replace($string, $search, $replace) if (Smarty::$_MBSTRING) { if (!$is_loaded) { if (!is_callable('smarty_mb_str_replace')) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'); + include_once SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php'; } $is_loaded = true; } - return smarty_mb_str_replace($search, $replace, $string); + return smarty_mb_str_replace($search, $replace, $string); } - return str_replace($search, $replace, $string); } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.spacify.php b/vendor/smarty/smarty/libs/plugins/modifier.spacify.php index 1e29fd553..98efd4b30 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.spacify.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.spacify.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty spacify modifier plugin * Type: modifier @@ -23,5 +22,5 @@ function smarty_modifier_spacify($string, $spacify_char = ' ') { // well… what about charsets besides latin and UTF-8? - return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, - 1, PREG_SPLIT_NO_EMPTY)); + return implode($spacify_char, preg_split('//' . Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY)); } diff --git a/vendor/smarty/smarty/libs/plugins/modifier.truncate.php b/vendor/smarty/smarty/libs/plugins/modifier.truncate.php index bb9df92d7..bb881bf6e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.truncate.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.truncate.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifier */ - /** * Smarty truncate modifier plugin * Type: modifier @@ -30,25 +29,24 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if ($length === 0) { return ''; } - if (Smarty::$_MBSTRING) { if (mb_strlen($string, Smarty::$_CHARSET) > $length) { $length -= min($length, mb_strlen($etc, Smarty::$_CHARSET)); if (!$break_words && !$middle) { - $string = preg_replace('/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, '', - mb_substr($string, 0, $length + 1, Smarty::$_CHARSET)); + $string = preg_replace( + '/\s+?(\S+)?$/' . Smarty::$_UTF8_MODIFIER, + '', + mb_substr($string, 0, $length + 1, Smarty::$_CHARSET) + ); } if (!$middle) { return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc; } - return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . - mb_substr($string, - $length / 2, $length, Smarty::$_CHARSET); + mb_substr($string, -$length / 2, $length, Smarty::$_CHARSET); } - return $string; } - // no MBString fallback if (isset($string[ $length ])) { $length -= min($length, strlen($etc)); @@ -58,9 +56,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if (!$middle) { return substr($string, 0, $length) . $etc; } - - return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2); + return substr($string, 0, $length / 2) . $etc . substr($string, -$length / 2); } - return $string; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php index 919b03c39..21d0e6624 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.cat.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty cat modifier plugin * Type: modifier @@ -15,9 +14,9 @@ * Input: string to catenate * Example: {$var|cat:"foo"} * - * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat + * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat * (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php index 8116aa327..6c44278af 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_characters.php @@ -5,14 +5,14 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_characters modifier plugin * Type: modifier * Name: count_characters * Purpose: count the number of characters in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual) + * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online + * manual) * @author Uwe Tews * * @param array $params parameters diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php index 1917d290a..e214a56f0 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_paragraphs.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_paragraphs modifier plugin * Type: modifier * Name: count_paragraphs * Purpose: count the number of paragraphs in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php + * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php * count_paragraphs (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php index a782d8e0b..027745635 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_sentences.php @@ -5,16 +5,15 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_sentences modifier plugin * Type: modifier * Name: count_sentences * Purpose: count the number of sentences in a text * - * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php + * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php * count_sentences (Smarty online manual) - * @author Uwe Tews + * @author Uwe Tews * * @param array $params parameters * diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php index dc8500c75..6d889da5c 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.count_words.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty count_words modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php index 9fe5d4da2..ae886c4b2 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.default.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty default modifier plugin * Type: modifier @@ -25,11 +24,9 @@ function smarty_modifiercompiler_default($params) if (!isset($params[ 1 ])) { $params[ 1 ] = "''"; } - array_shift($params); foreach ($params as $param) { $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)'; } - return $output; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php index 6a6e01637..e0763adce 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php @@ -14,8 +14,8 @@ * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual) * @author Rodney Rehm * - * @param array $params parameters - * @param Smarty_Internal_TemplateCompilerBase $compiler + * @param array $params parameters + * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code * @throws \SmartyException @@ -24,21 +24,24 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile { static $_double_encode = null; static $is_loaded = false; - $compiler->template->_checkPlugins(array(array('function' => 'smarty_literal_compiler_param', - 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php'))); + $compiler->template->_checkPlugins( + array( + array( + 'function' => 'smarty_literal_compiler_param', + 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php' + ) + ) + ); if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } - try { $esc_type = smarty_literal_compiler_param($params, 1, 'html'); $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET); $double_encode = smarty_literal_compiler_param($params, 3, true); - if (!$char_set) { $char_set = Smarty::$_CHARSET; } - switch ($esc_type) { case 'html': if ($_double_encode) { @@ -49,7 +52,7 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile } else { // fall back to modifier.escape.php } - + // no break case 'htmlall': if (Smarty::$_MBSTRING) { if ($_double_encode) { @@ -65,7 +68,6 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile // fall back to modifier.escape.php } } - // no MBString fallback if ($_double_encode) { // php >=5.2.3 - go native @@ -77,27 +79,23 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile } else { // fall back to modifier.escape.php } - + // no break case 'url': return 'rawurlencode(' . $params[ 0 ] . ')'; - case 'urlpathinfo': return 'str_replace("%2F", "/", rawurlencode(' . $params[ 0 ] . '))'; - case 'quotes': // escape unescaped single quotes return 'preg_replace("%(? "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", " "<\/" ))'; } - } - catch (SmartyException $e) { + } catch (SmartyException $e) { // pass through to regular plugin fallback } - // could not optimize |escape call, so fallback to regular plugin if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] = @@ -110,6 +108,5 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } - return 'smarty_modifier_escape(' . join(', ', $params) . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php index b5732db42..acce7784b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.from_charset.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty from_charset modifier plugin * Type: modifier @@ -24,10 +23,8 @@ function smarty_modifiercompiler_from_charset($params) // FIXME: (rodneyrehm) shouldn't this throw an error? return $params[ 0 ]; } - if (!isset($params[ 1 ])) { $params[ 1 ] = '"ISO-8859-1"'; } - return 'mb_convert_encoding(' . $params[ 0 ] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[ 1 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php index fede8aa74..2088ad6a8 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.indent.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty indent modifier plugin * Type: modifier @@ -19,7 +18,6 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_indent($params) { if (!isset($params[ 1 ])) { @@ -28,6 +26,5 @@ function smarty_modifiercompiler_indent($params) if (!isset($params[ 2 ])) { $params[ 2 ] = "' '"; } - return 'preg_replace(\'!^!m\',str_repeat(' . $params[ 2 ] . ',' . $params[ 1 ] . '),' . $params[ 0 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php index 8c6c26a89..0d899a002 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.lower.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty lower modifier plugin * Type: modifier @@ -20,7 +19,6 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_lower($params) { if (Smarty::$_MBSTRING) { diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php index 455cfe14b..1275190e0 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.noprint.php @@ -5,14 +5,13 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty noprint modifier plugin * Type: modifier * Name: noprint * Purpose: return an empty string * - * @author Uwe Tews + * @author Uwe Tews * @return string with compiled code */ function smarty_modifiercompiler_noprint() diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php index 8d3bfa4e2..663094311 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.string_format.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty string_format modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php index 3b7ade5ed..04ea332c5 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty strip modifier plugin * Type: modifier @@ -22,12 +21,10 @@ * * @return string with compiled code */ - function smarty_modifiercompiler_strip($params) { if (!isset($params[ 1 ])) { $params[ 1 ] = "' '"; } - return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})"; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php index 5ddca7a94..1bca1a28e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.strip_tags.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty strip_tags modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php index 889005712..d652eab1b 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.to_charset.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty to_charset modifier plugin * Type: modifier @@ -24,10 +23,8 @@ function smarty_modifiercompiler_to_charset($params) // FIXME: (rodneyrehm) shouldn't this throw an error? return $params[ 0 ]; } - if (!isset($params[ 1 ])) { $params[ 1 ] = '"ISO-8859-1"'; } - return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 1 ] . ', "' . addslashes(Smarty::$_CHARSET) . '")'; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php index 5a94e0727..05beb81f5 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty unescape modifier plugin * Type: modifier @@ -28,22 +27,17 @@ function smarty_modifiercompiler_unescape($params) } else { $params[ 2 ] = "'{$params[ 2 ]}'"; } - switch (trim($params[ 1 ], '"\'')) { case 'entity': case 'htmlall': if (Smarty::$_MBSTRING) { return 'mb_convert_encoding(' . $params[ 0 ] . ', ' . $params[ 2 ] . ', \'HTML-ENTITIES\')'; } - return 'html_entity_decode(' . $params[ 0 ] . ', ENT_NOQUOTES, ' . $params[ 2 ] . ')'; - case 'html': return 'htmlspecialchars_decode(' . $params[ 0 ] . ', ENT_QUOTES)'; - case 'url': return 'rawurldecode(' . $params[ 0 ] . ')'; - default: return $params[ 0 ]; } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php index d0d5cc7c3..ea4e95b7a 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.upper.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty upper modifier plugin * Type: modifier diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php index 94a0cf602..8565f140e 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.wordwrap.php @@ -33,7 +33,7 @@ function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompi } $function = 'wordwrap'; if (Smarty::$_MBSTRING) { - $function = $compiler->getPlugin('mb_wordwrap','modifier'); + $function = $compiler->getPlugin('mb_wordwrap', 'modifier'); } return $function . '(' . $params[ 0 ] . ',' . $params[ 1 ] . ',' . $params[ 2 ] . ',' . $params[ 3 ] . ')'; } diff --git a/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php b/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php index 70a66d3da..7e4503a1c 100644 --- a/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php +++ b/vendor/smarty/smarty/libs/plugins/outputfilter.trimwhitespace.php @@ -5,85 +5,85 @@ * @package Smarty * @subpackage PluginsFilter */ - /** * Smarty trimwhitespace outputfilter plugin * Trim unnecessary whitespace from HTML markup. * - * @author Rodney Rehm + * @author Rodney Rehm * * @param string $source input string * * @return string filtered output - * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail! + * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail! */ function smarty_outputfilter_trimwhitespace($source) { $store = array(); $_store = 0; $_offset = 0; - // Unify Line-Breaks to \n $source = preg_replace('/\015\012|\015|\012/', "\n", $source); - // capture Internet Explorer and KnockoutJS Conditional Comments - if (preg_match_all('##is', $source, $matches, - PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { + if (preg_match_all( + '##is', + $source, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ]; $_length = strlen($match[ 0 ][ 0 ]); $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); - $_offset += $_length - strlen($replace); - $_store ++; + $_store++; } } - // Strip all HTML-Comments // yes, even the ones in - - + + +
{{include file="cloud_header.tpl"}} diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index be09fbebf..2670ba9e7 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -42,9 +42,9 @@ function enableOnUser(){ } - - - + + + - - + + +