- Patch #45107 by chx: minor code speedups.
parent
a50eb34bda
commit
e41e8acda3
|
@ -827,7 +827,7 @@ function format_interval($timestamp, $granularity = 2) {
|
||||||
* A translated date string in the requested format.
|
* A translated date string in the requested format.
|
||||||
*/
|
*/
|
||||||
function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL) {
|
function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL) {
|
||||||
if ($timezone === NULL) {
|
if (!isset($timezone)) {
|
||||||
global $user;
|
global $user;
|
||||||
if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
|
if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
|
||||||
$timezone = $user->timezone;
|
$timezone = $user->timezone;
|
||||||
|
@ -945,8 +945,8 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache the clean_url variable to improve performance.
|
// Cache the clean_url variable to improve performance.
|
||||||
if ($clean_url === NULL) {
|
if (!isset($clean_url)) {
|
||||||
$clean_url = (variable_get('clean_url', '0') == '0') ? false : true;
|
$clean_url = (bool)variable_get('clean_url', '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
$base = ($absolute ? $base_url .'/' : '');
|
$base = ($absolute ? $base_url .'/' : '');
|
||||||
|
|
Loading…
Reference in New Issue