Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
7797c5628f
commit
54ca37dc65
@ -539,7 +539,7 @@ if ($socid > 0)
|
||||
else
|
||||
{
|
||||
$colspan = 8;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan += 2;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -695,7 +695,7 @@ if ($socid > 0)
|
||||
else
|
||||
{
|
||||
$colspan = 8;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan += 2;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -897,7 +897,7 @@ if ($socid > 0)
|
||||
else
|
||||
{
|
||||
$colspan = 8;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan += 2;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
@ -1073,7 +1073,7 @@ if ($socid > 0)
|
||||
else
|
||||
{
|
||||
$colspan = 8;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan+=2;
|
||||
if (!empty($conf->multicurrency->enabled)) $colspan += 2;
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -28,31 +28,31 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
|
||||
|
||||
// Define $website
|
||||
if (! is_object($website))
|
||||
if (!is_object($website))
|
||||
{
|
||||
$website=new Website($db);
|
||||
$website = new Website($db);
|
||||
$website->fetch(0, $websitekey);
|
||||
}
|
||||
// Define $weblangs
|
||||
if (! is_object($weblangs))
|
||||
if (!is_object($weblangs))
|
||||
{
|
||||
$weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice
|
||||
$weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice
|
||||
}
|
||||
// Define $websitepage if we have $websitepagefile defined
|
||||
if (! $pageid && ! empty($websitepagefile))
|
||||
if (!$pageid && !empty($websitepagefile))
|
||||
{
|
||||
$pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile));
|
||||
if ($pageid == 'index.php') $pageid = $website->fk_default_home;
|
||||
}
|
||||
if (! is_object($websitepage))
|
||||
if (!is_object($websitepage))
|
||||
{
|
||||
$websitepage=new WebsitePage($db);
|
||||
$websitepage = new WebsitePage($db);
|
||||
}
|
||||
if ($pageid > 0)
|
||||
{
|
||||
$websitepage->fetch($pageid);
|
||||
|
||||
if (! defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other')))
|
||||
if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other')))
|
||||
{
|
||||
$weblangs->load("website");
|
||||
http_response_code(404);
|
||||
@ -61,7 +61,7 @@ if ($pageid > 0)
|
||||
}
|
||||
}
|
||||
|
||||
if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {
|
||||
if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) {
|
||||
header("X-Content-Type-Options: nosniff");
|
||||
/* TODO Manage allow_frames flag on websitepage.
|
||||
if (empty($websitepage->allow_frames) && empty($conf->global->WEBSITE_ALLOW_FRAMES_ON_ALL_PAGES)) {
|
||||
@ -78,13 +78,13 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing
|
||||
//print_r(get_defined_constants(true));exit;
|
||||
if (GETPOST('l', 'aZ09'))
|
||||
{
|
||||
$sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp";
|
||||
$sql.=" WHERE wp.fk_website = ".$website->id;
|
||||
$sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid;
|
||||
if (is_object($websitepage) && $websitepage->fk_page > 0) $sql.=" OR wp.fk_page = ".$websitepage->fk_page." OR wp.rowid = ".$websitepage->fk_page;
|
||||
$sql.=")";
|
||||
$sql.= " AND wp.lang = '".$db->escape(GETPOST('l', 'aZ09'))."'";
|
||||
$sql = "SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp";
|
||||
$sql .= " WHERE wp.fk_website = ".$website->id;
|
||||
$sql .= " AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid;
|
||||
if (is_object($websitepage) && $websitepage->fk_page > 0) $sql .= " OR wp.fk_page = ".$websitepage->fk_page." OR wp.rowid = ".$websitepage->fk_page;
|
||||
$sql .= ")";
|
||||
$sql .= " AND wp.lang = '".$db->escape(GETPOST('l', 'aZ09'))."'";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -112,7 +112,7 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing
|
||||
}
|
||||
|
||||
// Show off line message
|
||||
if (! defined('USEDOLIBARREDITOR') && empty($website->status))
|
||||
if (!defined('USEDOLIBARREDITOR') && empty($website->status))
|
||||
{
|
||||
$weblangs->load("website");
|
||||
http_response_code(503);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user