Minor fixes
This commit is contained in:
@@ -383,7 +383,7 @@ class Db extends PhpObject
|
||||
private function addQuotes($oData)
|
||||
{
|
||||
//TODO remake
|
||||
$asTrustedFunc = array('CURDATE()', 'NOW()');
|
||||
$asTrustedFunc = array('CURDATE()', 'NOW()', 'NULL');
|
||||
$sChar = "'";
|
||||
if(is_array($oData))
|
||||
{
|
||||
@@ -574,7 +574,7 @@ class Db extends PhpObject
|
||||
{
|
||||
if(is_array($asConstraints))
|
||||
{
|
||||
if(array_key_exists($sField, $asInfo['constOpe']) && $asInfo['constOpe'][$sField]=='BETWEEN') {
|
||||
if(array_key_exists('constOpe', $asInfo) && array_key_exists($sField, $asInfo['constOpe']) && $asInfo['constOpe'][$sField]=='BETWEEN') {
|
||||
//Between
|
||||
$asSelection[$sField] = $asConstraints['from'].' AND '.$asConstraints['to'];
|
||||
$asInfo['constOpe'][$sField] = " BETWEEN ";
|
||||
|
||||
@@ -232,16 +232,14 @@ class Feed extends PhpObject
|
||||
|
||||
private static function cleanRss($oText)
|
||||
{
|
||||
$asForbiddenChars = array('&', '<', '>', '"', "'");
|
||||
$asReplacementCode = array('&', '<', '>', '"', ''');
|
||||
if(!is_array($oText))
|
||||
{
|
||||
return str_replace($asForbiddenChars, $asReplacementCode, $oText);
|
||||
return htmlspecialchars($oText, ENT_QUOTES);
|
||||
}
|
||||
elseif(count($oText)>0)
|
||||
{
|
||||
$oTextKeys = array_map(array($this, 'cleanRss'), array_keys($oText));
|
||||
$oTextValues = array_map(array($this, 'cleanRss'), array_values($oText));
|
||||
$oTextKeys = array_map(array(self, 'cleanRss'), array_keys($oText));
|
||||
$oTextValues = array_map(array(self, 'cleanRss'), array_values($oText));
|
||||
return array_combine($oTextKeys, $oTextValues);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -538,7 +538,7 @@ class ToolBox
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*20) $sDesc = '15 minutes ago';
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*50) $sDesc = 'half an hour ago';
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*2) $sDesc = 'an hour ago';
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*24 && $sDay==$sCurDay) $sDesc = 'at '.$sHour.' o\'clock';
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*24 && $sDay==$sCurDay) $sDesc = 'at '.date('gA', $iTimeStamp);
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*24) $sDesc = 'yesterday';
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7 && $sWeek==$sCurWeek) $sDesc = $asWeekDays[$sWeekDay-1];
|
||||
elseif($sCurTimeStamp-$iTimeStamp<60*60*24*7) $sDesc = 'last '.$asWeekDays[$sWeekDay-1];
|
||||
|
||||
Reference in New Issue
Block a user