1
0
Fork 0
Dieser Commit ist enthalten in:
o.pinke 2020-07-24 19:31:13 +02:00
Ursprung dcc1f7f323
Commit dc11334aaf
1 geänderte Dateien mit 165 neuen und 192 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -31,7 +32,6 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -42,7 +42,6 @@ function checkLinks() {
global $aSearchIDInfosArt, $aSearchIDInfosCat, $aSearchIDInfosCatArt, $aSearchIDInfosNonID; global $aSearchIDInfosArt, $aSearchIDInfosCat, $aSearchIDInfosCatArt, $aSearchIDInfosNonID;
if (count($aSearchIDInfosArt) > 0) { // Checks idarts if (count($aSearchIDInfosArt) > 0) { // Checks idarts
for ($i = 0; $i < count($aSearchIDInfosArt); $i++) { for ($i = 0; $i < count($aSearchIDInfosArt); $i++) {
if ($i == 0) { if ($i == 0) {
@ -50,7 +49,6 @@ function checkLinks() {
} else { } else {
$sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosArt[$i]['id']); $sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosArt[$i]['id']);
} }
} }
// Check articles // Check articles
@ -69,9 +67,7 @@ function checkLinks() {
} elseif (!isset($aFind[$aSearchIDInfosArt[$i]['id']])) { } elseif (!isset($aFind[$aSearchIDInfosArt[$i]['id']])) {
$aErrors['art'][] = array_merge($aSearchIDInfosArt[$i], array("error_type" => "unknown")); $aErrors['art'][] = array_merge($aSearchIDInfosArt[$i], array("error_type" => "unknown"));
} }
} }
} }
$int_cnt_aSearchIDInfosCat = 0; $int_cnt_aSearchIDInfosCat = 0;
@ -81,7 +77,6 @@ function checkLinks() {
} }
if ($int_cnt_aSearchIDInfosCat > 0) { // Checks idcats if ($int_cnt_aSearchIDInfosCat > 0) { // Checks idcats
for ($i = 0; $i < $int_cnt_aSearchIDInfosCat; $i++) { for ($i = 0; $i < $int_cnt_aSearchIDInfosCat; $i++) {
if ($i == 0) { if ($i == 0) {
@ -89,7 +84,6 @@ function checkLinks() {
} else { } else {
$sSearch .= ", " . $aSearchIDInfosCat[$i]['id']; $sSearch .= ", " . $aSearchIDInfosCat[$i]['id'];
} }
} }
// Check categorys // Check categorys
@ -119,15 +113,11 @@ function checkLinks() {
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$aErrors['cat'][] = array_merge($aSearchIDInfosCat[$i], array("error_type" => "startart")); $aErrors['cat'][] = array_merge($aSearchIDInfosCat[$i], array("error_type" => "startart"));
} }
} }
} }
} }
if (count($aSearchIDInfosCatArt) > 0) { // Checks idcatarts if (count($aSearchIDInfosCatArt) > 0) { // Checks idcatarts
for ($i = 0; $i < count($aSearchIDInfosCatArt); $i++) { for ($i = 0; $i < count($aSearchIDInfosCatArt); $i++) {
if ($i == 0) { if ($i == 0) {
@ -135,7 +125,6 @@ function checkLinks() {
} else { } else {
$sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosCatArt[$i]['id']); $sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosCatArt[$i]['id']);
} }
} }
// Check articles // Check articles
@ -152,13 +141,10 @@ function checkLinks() {
if (!in_array($aSearchIDInfosCatArt[$i]['id'], $aFind)) { if (!in_array($aSearchIDInfosCatArt[$i]['id'], $aFind)) {
$aErrors['art'][] = array_merge($aSearchIDInfosCatArt[$i], array("error_type" => "unknown")); $aErrors['art'][] = array_merge($aSearchIDInfosCatArt[$i], array("error_type" => "unknown"));
} }
} }
} }
if (count($aSearchIDInfosNonID) != 0) { // Checks other links (e. g. http, www, dfbs) if (count($aSearchIDInfosNonID) != 0) { // Checks other links (e. g. http, www, dfbs)
// Select userrights (is the user admin or sysadmin?) // Select userrights (is the user admin or sysadmin?)
$sql = "SELECT username FROM " . $cfg['tab']['phplib_auth_user_md5'] . " WHERE user_id='" . Contenido_Security::escapeDB($auth->auth['uid'], $db) . "' AND perms LIKE '%admin%'"; $sql = "SELECT username FROM " . $cfg['tab']['phplib_auth_user_md5'] . " WHERE user_id='" . Contenido_Security::escapeDB($auth->auth['uid'], $db) . "' AND perms LIKE '%admin%'";
$db->query($sql); $db->query($sql);
@ -184,9 +170,7 @@ function checkLinks() {
} else { } else {
$aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown")); $aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
} }
} }
} elseif (substr($aSearchIDInfosNonID[$i]['url'], strlen($aSearchIDInfosNonID[$i]['url']) - 5, 5) == ".html") { } elseif (substr($aSearchIDInfosNonID[$i]['url'], strlen($aSearchIDInfosNonID[$i]['url']) - 5, 5) == ".html") {
$iPing = @file_exists($cfgClient[$client]['path']['htmlpath'] . $aSearchIDInfosNonID[$i]['url']); $iPing = @file_exists($cfgClient[$client]['path']['htmlpath'] . $aSearchIDInfosNonID[$i]['url']);
@ -194,7 +178,6 @@ function checkLinks() {
if (!$iPing) { if (!$iPing) {
$aErrors['art'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown")); $aErrors['art'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
} }
} elseif (substr($aSearchIDInfosNonID[$i]['url'], 0, 20) == "dbfs.php?file=dbfs:/") { } elseif (substr($aSearchIDInfosNonID[$i]['url'], 0, 20) == "dbfs.php?file=dbfs:/") {
$sDBurl = substr($aSearchIDInfosNonID[$i]['url'], 20, strlen($aSearchIDInfosNonID[$i]['url'])); $sDBurl = substr($aSearchIDInfosNonID[$i]['url'], 20, strlen($aSearchIDInfosNonID[$i]['url']));
@ -210,7 +193,6 @@ function checkLinks() {
if ($db->num_rows() == 0) { if ($db->num_rows() == 0) {
$aErrors['docimages'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "dbfs")); $aErrors['docimages'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "dbfs"));
} }
} else { } else {
if (!file_exists($cfgClient[$client]['path']['frontend'] . $aSearchIDInfosNonID[$i]['url'])) { if (!file_exists($cfgClient[$client]['path']['frontend'] . $aSearchIDInfosNonID[$i]['url'])) {
@ -220,17 +202,12 @@ function checkLinks() {
} else { } else {
$aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown")); $aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
} }
} }
} }
} }
} }
return $aErrors; return $aErrors;
} }
// Searchs front_content.php-links // Searchs front_content.php-links
@ -286,9 +263,7 @@ function searchLinks($sValue, $iArt, $sArt, $iCat, $sCat, $iLang, $sFromtype = "
if (!in_array($aMatches[1][$i], $aWhitelist)) { if (!in_array($aMatches[1][$i], $aWhitelist)) {
$aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "extern"); $aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "extern");
} }
} }
} }
// Redirect // Redirect
@ -307,10 +282,8 @@ function searchLinks($sValue, $iArt, $sArt, $iCat, $sCat, $iLang, $sFromtype = "
if (strpos($aMatches[1][$i], "front_content.php") === false && !in_array($aMatches[1][$i], $aWhitelist)) { if (strpos($aMatches[1][$i], "front_content.php") === false && !in_array($aMatches[1][$i], $aWhitelist)) {
$aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "intern"); $aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "intern");
} }
}
}
} }
}
}
?> ?>