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
/**
* Project:
* Contenido Content Management System
@ -31,7 +32,6 @@
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -42,7 +42,6 @@ function checkLinks() {
global $aSearchIDInfosArt, $aSearchIDInfosCat, $aSearchIDInfosCatArt, $aSearchIDInfosNonID;
if (count($aSearchIDInfosArt) > 0) { // Checks idarts
for ($i = 0; $i < count($aSearchIDInfosArt); $i++) {
if ($i == 0) {
@ -50,7 +49,6 @@ function checkLinks() {
} else {
$sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosArt[$i]['id']);
}
}
// Check articles
@ -69,9 +67,7 @@ function checkLinks() {
} elseif (!isset($aFind[$aSearchIDInfosArt[$i]['id']])) {
$aErrors['art'][] = array_merge($aSearchIDInfosArt[$i], array("error_type" => "unknown"));
}
}
}
$int_cnt_aSearchIDInfosCat = 0;
@ -81,7 +77,6 @@ function checkLinks() {
}
if ($int_cnt_aSearchIDInfosCat > 0) { // Checks idcats
for ($i = 0; $i < $int_cnt_aSearchIDInfosCat; $i++) {
if ($i == 0) {
@ -89,7 +84,6 @@ function checkLinks() {
} else {
$sSearch .= ", " . $aSearchIDInfosCat[$i]['id'];
}
}
// Check categorys
@ -119,15 +113,11 @@ function checkLinks() {
if ($db->num_rows() == 0) {
$aErrors['cat'][] = array_merge($aSearchIDInfosCat[$i], array("error_type" => "startart"));
}
}
}
}
if (count($aSearchIDInfosCatArt) > 0) { // Checks idcatarts
for ($i = 0; $i < count($aSearchIDInfosCatArt); $i++) {
if ($i == 0) {
@ -135,7 +125,6 @@ function checkLinks() {
} else {
$sSearch .= ", " . Contenido_Security::toInteger($aSearchIDInfosCatArt[$i]['id']);
}
}
// Check articles
@ -152,13 +141,10 @@ function checkLinks() {
if (!in_array($aSearchIDInfosCatArt[$i]['id'], $aFind)) {
$aErrors['art'][] = array_merge($aSearchIDInfosCatArt[$i], array("error_type" => "unknown"));
}
}
}
if (count($aSearchIDInfosNonID) != 0) { // Checks other links (e. g. http, www, dfbs)
// 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%'";
$db->query($sql);
@ -184,9 +170,7 @@ function checkLinks() {
} else {
$aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
}
}
} elseif (substr($aSearchIDInfosNonID[$i]['url'], strlen($aSearchIDInfosNonID[$i]['url']) - 5, 5) == ".html") {
$iPing = @file_exists($cfgClient[$client]['path']['htmlpath'] . $aSearchIDInfosNonID[$i]['url']);
@ -194,7 +178,6 @@ function checkLinks() {
if (!$iPing) {
$aErrors['art'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
}
} elseif (substr($aSearchIDInfosNonID[$i]['url'], 0, 20) == "dbfs.php?file=dbfs:/") {
$sDBurl = substr($aSearchIDInfosNonID[$i]['url'], 20, strlen($aSearchIDInfosNonID[$i]['url']));
@ -210,7 +193,6 @@ function checkLinks() {
if ($db->num_rows() == 0) {
$aErrors['docimages'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "dbfs"));
}
} else {
if (!file_exists($cfgClient[$client]['path']['frontend'] . $aSearchIDInfosNonID[$i]['url'])) {
@ -220,17 +202,12 @@ function checkLinks() {
} else {
$aErrors['others'][] = array_merge($aSearchIDInfosNonID[$i], array("error_type" => "unknown"));
}
}
}
}
}
return $aErrors;
}
// 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)) {
$aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "extern");
}
}
}
// 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)) {
$aSearchIDInfosNonID[] = array("url" => $aMatches[1][$i], "idart" => $iArt, "nameart" => $sArt, "idcat" => $iCat, "namecat" => $sCat, "lang" => $iLang, "urltype" => "intern");
}
}
}
}
}
}
?>