Skip to content

Commit ad717c9

Browse files
committed
Releasing 1.1.23
2 parents 54cde96 + 1f2b9b5 commit ad717c9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/TgLog/Log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public static function clean() {
326326
* @return array list of messages registered.
327327
*/
328328
public static function get() {
329-
return $_SESSION['messages'];
329+
return isset($_SESSION['messages']) ? $_SESSION['messages'] : array();
330330
}
331331

332332
/**

src/TgUtils/Date.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function calendar($format, $local = false, $translate = true) {
263263
* @return string The date string in the specified format format.
264264
*
265265
*/
266-
public function format($format, $local = false, $translate = true, $language = null) {
266+
public function format($format, $local = false, $translate = true, $language = null):string {
267267
if ($translate) {
268268
// Do string replacements for date format options that can be translated.
269269
$format = preg_replace('/(^|[^\\\])D/', "\\1" . self::DAY_ABBR, $format);
@@ -366,7 +366,7 @@ public function monthToString($month, $abbr = false, $language = null) {
366366
*
367367
* @note This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483
368368
*/
369-
public function setTimezone($tz) {
369+
public function setTimezone($tz):\DateTime {
370370
$this->tz = $tz;
371371

372372
return parent::setTimezone($tz);

src/TgUtils/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ protected function initDocumentRoot() {
321321
*/
322322
protected function initOriginalPath() {
323323
$rc = $this->path;
324-
$rootDef = $_SERVER['HTTP_X_FORWARDED_ROOT'];
324+
$rootDef = isset($_SERVER['HTTP_X_FORWARDED_ROOT']) ? $_SERVER['HTTP_X_FORWARDED_ROOT'] : '';
325325
if ($rootDef) {
326326
$arr = explode(',', $rootDef);
327327
if (strpos($rc, $arr[0]) === 0) {
@@ -353,7 +353,7 @@ protected function initOriginalUri() {
353353
*/
354354
protected function initWebRoot($considerForwarding = TRUE) {
355355
if ($considerForwarding) {
356-
$rootDef = $_SERVER['HTTP_X_FORWARDED_ROOT'];
356+
$rootDef = isset($_SERVER['HTTP_X_FORWARDED_ROOT']) ? $_SERVER['HTTP_X_FORWARDED_ROOT'] : '';
357357
if ($rootDef) {
358358
$arr = explode(',', $rootDef);
359359
$rc = $arr[1];

0 commit comments

Comments
 (0)