Skip to content

Commit

Permalink
Fix: fix preg_match parameter#2 $subject is null deprecated issue (ty…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchipset authored Sep 23, 2024
1 parent 5783cb0 commit 91876b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion var/Typecho/I18n/GetText.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ private function getPluralForms(): string
} else {
$header = $this->getTranslationString(0);
}
if (preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) {

if (!is_null($header) && preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) {
$expr = $regs[1];
} else {
$expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
Expand Down

0 comments on commit 91876b4

Please sign in to comment.