Mercurial > hg > rc2
comparison program/lib/Roundcube/rcube.php @ 15:85a746e95663
slowly working through deprecations/warnings from 8.3
| author | Charlie Root |
|---|---|
| date | Sat, 20 Sep 2025 12:16:50 -0400 |
| parents | 3a5f959af5ae |
| children | 73124dd49283 |
comparison
equal
deleted
inserted
replaced
| 14:abddb304201f | 15:85a746e95663 |
|---|---|
| 118 /* private/protected vars */ | 118 /* private/protected vars */ |
| 119 protected $texts; | 119 protected $texts; |
| 120 protected $caches = array(); | 120 protected $caches = array(); |
| 121 protected $shutdown_functions = array(); | 121 protected $shutdown_functions = array(); |
| 122 | 122 |
| 123 private $imap; | |
| 123 | 124 |
| 124 /** | 125 /** |
| 125 * This implements the 'singleton' design pattern | 126 * This implements the 'singleton' design pattern |
| 126 * | 127 * |
| 127 * @param integer $mode Options to initialize with this instance. See rcube::INIT_WITH_* constants | 128 * @param integer $mode Options to initialize with this instance. See rcube::INIT_WITH_* constants |
| 615 } | 616 } |
| 616 | 617 |
| 617 $name = (string) $attrib['name']; | 618 $name = (string) $attrib['name']; |
| 618 | 619 |
| 619 // attrib contain text values: use them from now | 620 // attrib contain text values: use them from now |
| 620 if (($setval = $attrib[strtolower($_SESSION['language'])]) || ($setval = $attrib['en_us'])) { | 621 if (($setval = $attrib[strtolower($_SESSION['language'])] ?? false) || ($setval = $attrib['en_us'] ?? false)) { |
| 621 $this->texts[$name] = $setval; | 622 $this->texts[$name] = $setval; |
| 622 } | 623 } |
| 623 // check for text with domain | 624 // check for text with domain |
| 624 if ($domain && ($text = $this->texts[$domain.'.'.$name])) { | 625 if ($domain && ($text = $this->texts[$domain.'.'.$name])) { |
| 625 } | 626 } |
| 626 // text does not exist | 627 // text does not exist |
| 627 else if (!($text = $this->texts[$name])) { | 628 else if (!($text = $this->texts[$name])) { |
| 628 return "[$name]"; | 629 return "[$name]"; |
| 629 } | 630 } |
| 630 // replace vars in text | 631 // replace vars in text |
| 631 if (is_array($attrib['vars'])) { | 632 if (is_array($attrib['vars'] ?? false)) { |
| 632 foreach ($attrib['vars'] as $var_key => $var_value) { | 633 foreach ($attrib['vars'] as $var_key => $var_value) { |
| 633 $text = str_replace($var_key[0] != '$' ? '$'.$var_key : $var_key, $var_value, $text); | 634 $text = str_replace($var_key[0] != '$' ? '$'.$var_key : $var_key, $var_value, $text); |
| 634 } | 635 } |
| 635 } | 636 } |
| 636 | 637 |
| 637 // replace \n with real line break | 638 // replace \n with real line break |
| 638 $text = strtr($text, array('\n' => "\n")); | 639 $text = strtr($text, array('\n' => "\n")); |
| 639 | 640 |
| 640 // case folding | 641 // case folding |
| 641 if (($attrib['uppercase'] && strtolower($attrib['uppercase']) == 'first') || $attrib['ucfirst']) { | 642 if ((($attrib['uppercase'] ?? false) && strtolower($attrib['uppercase']) == 'first') || ($attrib['ucfirst'] ?? false)) { |
| 642 $case_mode = MB_CASE_TITLE; | 643 $case_mode = MB_CASE_TITLE; |
| 643 } | 644 } |
| 644 else if ($attrib['uppercase']) { | 645 else if ($attrib['uppercase'] ?? false) { |
| 645 $case_mode = MB_CASE_UPPER; | 646 $case_mode = MB_CASE_UPPER; |
| 646 } | 647 } |
| 647 else if ($attrib['lowercase']) { | 648 else if ($attrib['lowercase'] ?? false) { |
| 648 $case_mode = MB_CASE_LOWER; | 649 $case_mode = MB_CASE_LOWER; |
| 649 } | 650 } |
| 650 | 651 |
| 651 if (isset($case_mode)) { | 652 if (isset($case_mode)) { |
| 652 $text = mb_convert_case($text, $case_mode); | 653 $text = mb_convert_case($text, $case_mode); |
