Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Commit d516369

Browse files
committed
Fixed deprecation errors
1 parent 8664383 commit d516369

File tree

15 files changed

+37
-101
lines changed

15 files changed

+37
-101
lines changed

lib/classes/artikel_class.php

Lines changed: 19 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,17 +1301,9 @@ function get_anzahl()
13011301
// Verfallstimestamp;
13021302
$dat = explode(".", $artikel->pub_verfall_page);
13031303

1304-
if(!isset($dat['2'])) {
1305-
$dat['2'] = NULL;
1306-
}
1307-
1308-
$dat_t1 = explode(" ", $dat['2']);
1309-
1310-
if(!isset($dat_t1['1'])) {
1311-
$dat_t1['1'] = NULL;
1312-
}
1304+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1305+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
13131306

1314-
$dat_t2 = explode(":", $dat_t1['1']);
13151307
if (empty($dat_t2['0'])) {
13161308
$dat_t2['0'] = "0";
13171309
}
@@ -1324,17 +1316,9 @@ function get_anzahl()
13241316
// Starttimestamp
13251317
$dat = explode(".", $artikel->pub_start_page);
13261318

1327-
if(!isset($dat['2'])) {
1328-
$dat['2'] = NULL;
1329-
}
1319+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1320+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
13301321

1331-
$dat_t1 = explode(" ", $dat['2']);
1332-
1333-
if(!isset($dat_t1['1'])) {
1334-
$dat_t1['1'] = NULL;
1335-
}
1336-
1337-
$dat_t2 = explode(":", $dat_t1['1']);
13381322
if (empty($dat_t2['0'])) {
13391323
$dat_t2['0'] = "0";
13401324
}
@@ -1365,13 +1349,8 @@ function get_anzahl()
13651349
// Verfallstimestamp
13661350
$dat = explode(".", $artikel->pub_verfall);
13671351

1368-
IfNotSetNull($dat['2']);
1369-
1370-
$dat_t1 = explode(" ", $dat['2']);
1371-
1372-
IfNotSetNull($dat_t1['1']);
1373-
1374-
$dat_t2 = explode(":", $dat_t1['1']);
1352+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1353+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
13751354

13761355
if (empty($dat_t2['0'])) {
13771356
$dat_t2['0'] = "0";
@@ -1385,13 +1364,9 @@ function get_anzahl()
13851364
// Starttimestamp
13861365
$dat = explode(".", $artikel->pub_start);
13871366

1388-
IfNotSetNull($dat['2']);
1389-
1390-
$dat_t1 = explode(" ", $dat['2']);
1367+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1368+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
13911369

1392-
IfNotSetNull($dat_t1['1']);
1393-
1394-
$dat_t2 = explode(":", $dat_t1['1']);
13951370
if (empty($dat_t2['0'])) {
13961371
$dat_t2['0'] = "0";
13971372
}
@@ -1927,21 +1902,12 @@ function get_artikel($menuid = 1, $modus = "", $start = 0)
19271902
// Verfallstimestamp
19281903
$dat = explode(".", $artikel->pub_verfall);
19291904

1930-
if(!isset($dat['2'])) {
1931-
$dat['2'] = NULL;
1932-
}
1933-
1934-
$dat_t1 = explode(" ", $dat['2']);
1905+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1906+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
19351907

1936-
if(!isset($dat_t1['1'])) {
1937-
$dat_t1['1'] = NULL;
1938-
}
1939-
1940-
$dat_t2 = explode(":", $dat_t1['1']);
19411908
if (empty($dat_t2['0'])) {
19421909
$dat_t2['0'] = "0";
19431910
}
1944-
19451911
if (empty($dat_t2['1'])) {
19461912
$dat_t2['1'] = "0";
19471913
}
@@ -1955,17 +1921,9 @@ function get_artikel($menuid = 1, $modus = "", $start = 0)
19551921
// Starttimestamp
19561922
$dat = explode(".", $artikel->pub_start);
19571923

1958-
if(!isset($dat['2'])) {
1959-
$dat['2'] = NULL;
1960-
}
1961-
1962-
$dat_t1 = explode(" ", $dat['2']);
1963-
1964-
if(!isset($dat_t1['1'])) {
1965-
$dat_t1['1'] = NULL;
1966-
}
1924+
$dat_t1 = isset($dat['2']) ? explode(" ", $dat['2']) : NULL;
1925+
$dat_t2 = isset($dat_t1['1']) ? explode(":", $dat_t1['1']) : NULL;
19671926

1968-
$dat_t2 = explode(":", $dat_t1['1']);
19691927
if ($dat[2] > 1970) {
19701928
$start = @mktime((int)$dat_t2['0'], (int)$dat_t2['1'], 0, (int)$dat[1], (int)$dat[0], (int)$dat[2]);
19711929
}
@@ -2838,16 +2796,14 @@ function make_teaser()
28382796
}
28392797
preg_match_all('/<img[^>]*>/Ui', $this->diverse->do_pfadeanpassen($row->lan_teaser), $img);
28402798

2841-
if(!isset($img['0']['0'])) {
2842-
$img['0']['0'] = NULL;
2799+
if (isset($img['0']['0'])) {
2800+
$img['0']['0'] = str_replace("/thumbs", "", $img['0']['0']);
2801+
$img['0']['0'] = str_replace("style", "rel", $img['0']['0']);
28432802
}
28442803
if(!isset($this->author)) {
28452804
$this->author = NULL;
28462805
}
28472806

2848-
$img['0']['0'] = str_replace("/thumbs", "", $img['0']['0']);
2849-
$img['0']['0'] = str_replace("style", "rel", $img['0']['0']);
2850-
28512807
$teaserVideoTag = preg_match('~<video(?=\s|>).*?</video>~i', $row->lan_teaser, $teaserVideoTag)
28522808
? $teaserVideoTag[0]
28532809
: '';
@@ -3634,11 +3590,11 @@ private function makeOpenGraphMetaTags()
36343590

36353591
// Werte fuer Open Graph Meta Tags erstellen
36363592
return array_merge($article, ["open_graph" => [
3637-
"title" => trim(strip_tags($articleData["title"])),
3638-
"description" => trim(strip_tags($articleData["meta_description"])),
3593+
"title" => trim(strip_tags($articleData["title"]) ?? ''),
3594+
"description" => trim(strip_tags($articleData["meta_description"]) ?? ''),
36393595
"type" => "Website",
3640-
"image" => trim($image),
3641-
"url" => trim($url),
3596+
"image" => trim($image ?? ''),
3597+
"url" => trim($url ?? ''),
36423598
]]);
36433599
}, $articles);
36443600

lib/classes/body_class.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ private function extraCss()
122122
if (!isset($this->content->template['extra_css'])) {
123123
$this->content->template['extra_css'] = null;
124124
}
125-
$css_file = $this->content->template['extra_css'];
126-
$css_class = strtolower(str_replace(".css", "-css", $css_file));
127-
$css_class = preg_replace("/[^a-z-]/", "-", $css_class);
128-
return $css_class;
125+
return preg_replace("/[^a-z-]/", "-", strtolower(str_replace(".css", "-css", $this->content->template['extra_css'] ?? '')));
129126
}
130127

131128
/**

lib/classes/cms_class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower',
18431843
// FIXME: Eigentlich nicht gesetzt, was war hier die Verwendung?
18441844
IfNotSetNull($abfrage_url);
18451845

1846-
if (count($result) == 0 && !stristr($abfrage_url, "keyword")) {
1846+
if (count($result) == 0 && !stristr($abfrage_url ?? '', "keyword")) {
18471847
$lastx = substr($sprechende_url_org, -1, 1);
18481848
$last2x = substr($sprechende_url_org, -5, 5);
18491849
if ($lastx != "/" && $last2x != ".html") {
@@ -1982,7 +1982,7 @@ function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower',
19821982
}
19831983
}
19841984

1985-
if (stristr($var[$max1], '.html') or $max == 1) {
1985+
if (isset($var) && stristr($var[$max1], '.html') or $max == 1) {
19861986
$this->get_reporeid($var[$max1]);
19871987
}
19881988
}
@@ -2449,7 +2449,7 @@ function get_reporeid($header)
24492449
IfNotSetNull($match[0]);
24502450
IfNotSetNull($match[1]);
24512451
$this->checked->menuid = (int)$match[1];
2452-
$header = str_replace($match[0], "", $header);
2452+
$header = str_replace($match[0] ?? "", "", $header);
24532453
}
24542454

24552455
$header_org = $header;

lib/classes/content_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private static function decode(array $data, array $nodeNames=[]): array
7373
else {
7474
// Skip previously decoded values
7575
$nodeName = implode('.', array_merge($nodeNames, [$name]));
76-
if (self::$decodedNodes[$nodeName] ?? false and preg_match('~^[a-z]+:~', $wert) == false) {
76+
if (self::$decodedNodes[$nodeName] ?? false and ($wert && !preg_match('~^[a-z]+:~', $wert))) {
7777
$temp_array[$name] = $wert;
7878
}
7979

lib/classes/diverse_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ public function recode_entity_n_br($text = "", $modus = "")
717717
*/
718718
public function encode_quote($text = "")
719719
{
720-
return str_replace(['"', "'"], ['&quot;', '&lsquo;'], $text);
720+
return str_replace(['"', "'"], ['&quot;', '&lsquo;'], $text ?? '');
721721
}
722722

723723
/**

lib/classes/intern_styles_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ function css_do_change()
501501
$this->content->template['not_writeable_file']="/styles/" . $pfad['0'] . "/css/" . $file;
502502
}
503503
$this->content->template['style_id'] = $this->checked->style_id;
504-
$this->content->template['xinhalt'] = "nodecode:" . utf8_encode($inhalt);
504+
$this->content->template['xinhalt'] = "nodecode:" . mb_convert_encoding($inhalt, 'UTF-8');
505505
$this->content->template['style_file_form'] = $file;
506506
$this->content->template['css_jquery_first'] = "1";
507507
}

lib/classes/kontaktform_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function check_checked_felder()
8585
if (is_array($value)) {
8686
continue;
8787
}
88-
$value=strip_tags($value);
88+
$value=strip_tags($value ?? '');
8989
$this->checked->$key=$this->diverse->encode_quote($value);
9090
}
9191
}

lib/classes/menu_class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ function ($match, $pattern) use ($menuLink) {
917917

918918
$menu['pointsToMenuOrArticle'] = false;
919919

920-
if (substr($menu["menulinklang"], 0, 1) === "/") {
920+
if ($menu["menulinklang"] && substr($menu["menulinklang"], 0, 1) === "/") {
921921
if ($isExtraFreeUrl || in_array($menu["menulinklang"], $urls, true)) {
922922
$menu["url_menuname"] = $menu["menulinklang"];
923923
$menu['pointsToMenuOrArticle'] = !$isExtraFreeUrl;
@@ -1359,11 +1359,11 @@ function menu_navigation_build($front_back = "", $shift_modus = "NAVIGATION", $b
13591359
IfNotSetNull($menupunkt['url_metadescrip']);
13601360
IfNotSetNull($menupunkt['url_metakeywords']);
13611361

1362-
if (strlen($menupunkt['url_metadescrip']) > 0) {
1362+
if ($menupunkt['url_metadescrip'] && strlen($menupunkt['url_metadescrip']) > 0) {
13631363
$this->content->template['description'] = $menupunkt['url_metadescrip'];
13641364
}
13651365

1366-
if (strlen($menupunkt['url_metakeywords']) > 0) {
1366+
if ($menupunkt['url_metakeywords'] && strlen($menupunkt['url_metakeywords']) > 0) {
13671367
$this->content->template['keywords'] = $menupunkt['url_metakeywords'];
13681368
}
13691369
}

lib/classes/sitemap_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function sitemap_table_build($sprach_id = "", $modus = "")
214214
$artikelurl="jgiusdhflghldjgsfdhgjsdhlkfjghlksjdgklhsdklghsdjklg";
215215
}
216216

217-
if (stristr( $menupunkt['menuname_url'],$artikelurl) ) {
217+
if (stristr( $menupunkt['menuname_url'] ?? '',$artikelurl) ) {
218218
$menupunkt['menuname_art_url']=str_replace($artikelurl,"",$menupunkt['menuname_url']);
219219
$is_url="ok";
220220
}

lib/classes/template_class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ function get_file_content($file_name="")
342342
}
343343
$inhalt=str_ireplace("\t"," ",$inhalt);
344344

345-
$inhalt=htmlentities(utf8_encode($inhalt));
345+
$inhalt=htmlentities(mb_convert_encoding($inhalt, 'UTF-8'));
346346
//template_file
347347
// FIXME: $sub2 war nie gesetzt was hatte man hier vor?
348348
IfNotSetNull($sub2);

0 commit comments

Comments
 (0)