Skip to content

Commit

Permalink
[BUGFIX] Fix warnings for undefined array keys in Mods class (#1227)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed May 30, 2024
1 parent 5b6f79a commit d24f9aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Format/Mods.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private function getHolderFromXml(array $holders, int $i): void
* Get holder from XML display form.
*
* @access private
*
*
* @param array $holders
* @param int $i
*
Expand Down Expand Up @@ -306,7 +306,7 @@ private function getPlaces(): void
if (!empty($places)) {
foreach ($places as $place) {
$this->metadata['place'][] = (string) $place;
if (!$this->metadata['place_sorting'][0]) {
if (empty($this->metadata['place_sorting'][0])) {
$this->metadata['place_sorting'][0] = preg_replace('/[[:punct:]]/', '', (string) $place);
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ private function getYears(): void
if (!empty($years)) {
foreach ($years as $year) {
$this->metadata['year'][] = (string) $year;
if (!$this->metadata['year_sorting'][0]) {
if (empty($this->metadata['year_sorting'][0])) {
$yearSorting = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $year));
if (
strpos($yearSorting, '.')
Expand Down

0 comments on commit d24f9aa

Please sign in to comment.