Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 18 additions & 18 deletions class2.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
{
foreach ($retrieve_prefs as $key => $pref_name)
{
$retrieve_prefs[$key] = preg_replace("/\W/", '', $pref_name);
$retrieve_prefs[$key] = preg_replace("/\W/", '', (string) $pref_name);
}
}
else
Expand Down Expand Up @@ -647,7 +647,7 @@

if(!defined('SITENAME')) // Allow override by English_custom.php or English_global.php plugin files.
{
define('SITENAME', trim($tp->toHTML($pref['sitename'], '', 'USER_TITLE,er_on,defs')));
define('SITENAME', trim((string) $tp->toHTML($pref['sitename'], '', 'USER_TITLE,er_on,defs')));
}

//
Expand Down Expand Up @@ -1195,7 +1195,7 @@ function check_email($email)
return false;
}

if(is_numeric(substr($email,-1))) // fix for eCaptcha accidently typed on wrong line.
if(is_numeric(substr((string) $email,-1))) // fix for eCaptcha accidently typed on wrong line.
{
return false;
}
Expand All @@ -1204,9 +1204,9 @@ function check_email($email)
{
return $email;
}

return false;

// return preg_match("/^([_a-zA-Z0-9-+]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,6})$/" , $email) ? $email : false;
}

Expand Down Expand Up @@ -1250,14 +1250,14 @@ function check_class($var, $userclass = null, $uid = 0)
return false;
}

$class_array = !is_array($userclass) ? explode(',', $userclass) : $userclass;
$class_array = !is_array($userclass) ? explode(',', (string) $userclass) : $userclass;

$varList = !is_array($var) ? explode(',', (string) $var) : $var;
$latchedAccess = false;

foreach ($varList as $v)
{
$v = trim($v);
$v = trim((string) $v);
$invert = false;
//value to test is a userclass name (or garbage, of course), go get the id
if (!is_numeric($v))
Expand Down Expand Up @@ -1358,7 +1358,7 @@ function getperms($arg, $ap = null, $path = null)
return true;
}

if ($arg === 'P' && preg_match('#(.*?)/' .e107::getFolder('plugins'). '(.*?)/(.*?)#', $path, $matches))
if ($arg === 'P' && preg_match('#(.*?)/' .e107::getFolder('plugins'). '(.*?)/(.*?)#', (string) $path, $matches))
{
$sql = e107::getDb('psql');

Expand Down Expand Up @@ -1876,7 +1876,7 @@ function session_set($name, $value, $expire='', $path = e_HTTP, $domain = '', $s
$path = '/';
}

setcookie($name, $value, $expire, $path, $domain, $secure, true);
setcookie($name, (string) $value, $expire, $path, $domain, $secure, true);
$_COOKIE[$name] = $value;
}
}
Expand Down Expand Up @@ -1994,7 +1994,7 @@ function force_userupdate($currentUser)
}
}

if (!e107::getPref('disable_emailcheck',true) && !trim($currentUser['user_email'])) return true;
if (!e107::getPref('disable_emailcheck',true) && !trim((string) $currentUser['user_email'])) return true;

if(e107::getDb()->select('user_extended_struct', 'user_extended_struct_applicable, user_extended_struct_write, user_extended_struct_name, user_extended_struct_type', 'user_extended_struct_required = 1 AND user_extended_struct_applicable != '.e_UC_NOBODY))
{
Expand Down Expand Up @@ -2068,7 +2068,7 @@ function __construct()
return;
}

if ((isset($_SERVER['QUERY_STRING']) && (strpos($_SERVER['QUERY_STRING'], 'debug=') !== false)) || isset($_COOKIE['e107_debug_level']) && ((strpos($_SERVER['QUERY_STRING'], 'debug=-')) === false) )
if ((isset($_SERVER['QUERY_STRING']) && (strpos((string) $_SERVER['QUERY_STRING'], 'debug=') !== false)) || isset($_COOKIE['e107_debug_level']) && ((strpos((string) $_SERVER['QUERY_STRING'], 'debug=-')) === false) )
{
$this->debug = true;
error_reporting(E_ALL);
Expand Down Expand Up @@ -2192,7 +2192,7 @@ function render_trace($array)
<td>";
$text .= !empty($val['class']) ? $val['class']."->" : '';
$text .= !empty($val['include_filename']) ? "include: ". str_replace($this->docroot,'', $val['include_filename']) : '';
$text .= !empty($val['function']) ? htmlentities($val['function'])."(" : "";
$text .= !empty($val['function']) ? htmlentities((string) $val['function'])."(" : "";
$text .= !empty($val['params']) ? print_r($val['params'],true) : '';
$text .= !empty($val['function']) ? ")" : "";
$text .="</td>
Expand Down Expand Up @@ -2276,7 +2276,7 @@ class e_http_header

function __construct()
{
if (strpos(varset($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') !== false)
if (strpos((string) varset($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') !== false)
{
$this->compression_browser_support = true;
}
Expand Down Expand Up @@ -2313,10 +2313,10 @@ function setContent($content,$search=null,$replace=null)
else
{
$this->content = $content;
$this->length = strlen($content);
$this->length = strlen((string) $content);
}

$this->etag = md5($this->content);
$this->etag = md5((string) $this->content);

//print_a($this->length);

Expand All @@ -2341,7 +2341,7 @@ function setHeader($header, $force=false, $response_code=null)
return null;
}

list($key,$val) = explode(':',$header,2);
list($key,$val) = explode(':',(string) $header,2);
$this->headers[$key] = $val;
header($header, $force, $response_code);
}
Expand All @@ -2367,7 +2367,7 @@ function debug() // needs to be disabled if PHP gzip is to work
$server = array();
foreach($_SERVER as $k=>$v)
{
if(strncmp($k, 'HTTP', 4) === 0)
if(strncmp((string) $k, 'HTTP', 4) === 0)
{
$server[$k] = $v;
}
Expand Down Expand Up @@ -2423,7 +2423,7 @@ function send()
if($this->compress_output !== false)
{
$this->setHeader('ETag: "'.$this->etag.'-gzip"', true);
$this->content = gzencode($this->content, $this->compression_level);
$this->content = gzencode((string) $this->content, $this->compression_level);
$this->length = strlen($this->content);
$this->setHeader('Content-Encoding: gzip', true);
$this->setHeader("Content-Length: ".$this->length, true);
Expand Down
6 changes: 3 additions & 3 deletions comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// Comment Pagination
if(varset($_GET['mode']) == 'list' && vartrue($_GET['id']) && vartrue($_GET['type']))
{
$clean_type = preg_replace("/[^\w\d]/","",$_GET['type']);
$clean_type = preg_replace("/[^\w\d]/","",(string) $_GET['type']);

$tmp = e107::getComment()->getComments($clean_type,intval($_GET['id']),intval($_GET['from']));
echo $tmp['comments'];
Expand Down Expand Up @@ -303,13 +303,13 @@
$plugin_redir = TRUE;
$reply_location = str_replace('{NID}', $redirectFlag, $e_comment[$table]['reply_location']);
}

if ($plugin_redir)
{
echo "<script>document.location.href='{$reply_location}'</script>\n";
exit;
}

// No redirect found if we get here.
}

Expand Down
14 changes: 7 additions & 7 deletions contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function init()
$pref = e107::pref();

$active = varset($pref['contact_visibility'], e_UC_PUBLIC);
$contactInfo = trim(SITECONTACTINFO);
$contactInfo = trim((string) SITECONTACTINFO);
$pref = e107::getPref();

if(!check_class($active) && empty($contactInfo) && empty($pref['contact_info']))
Expand Down Expand Up @@ -106,13 +106,13 @@ private function processFormSubmit()

if(!empty($contact_filter))
{
$tmp = explode("\n", $contact_filter);
$tmp = explode("\n", (string) $contact_filter);

if(!empty($tmp))
{
foreach($tmp as $filterItem)
{
if(strpos($_POST['body'], $filterItem) !== false)
if(strpos((string) $_POST['body'], $filterItem) !== false)
{
$ignore = true;
break;
Expand All @@ -127,7 +127,7 @@ private function processFormSubmit()
$sender_name = $tp->toEmail($_POST['author_name'], true, 'RAWTEXT');
$sender = check_email($_POST['email_send']);
$subject = $tp->toEmail($_POST['subject'], true, 'RAWTEXT');
$body = nl2br($tp->toEmail(strip_tags($_POST['body']), true, 'RAWTEXT'));
$body = nl2br((string) $tp->toEmail(strip_tags((string) $_POST['body']), true, 'RAWTEXT'));

$email_copy = !empty($_POST['email_copy']) ? 1 : 0;

Expand All @@ -144,12 +144,12 @@ private function processFormSubmit()
}

// Check subject line.
if(isset($_POST['subject']) && strlen(trim($subject)) < 2)
if(isset($_POST['subject']) && strlen(trim((string) $subject)) < 2)
{
$error .= LAN_CONTACT_13 . "\n";
}

if(!strpos(trim($sender), "@"))
if(!strpos(trim((string) $sender), "@"))
{
$error .= LAN_CONTACT_11 . "\n";
}
Expand Down Expand Up @@ -231,7 +231,7 @@ private function processFormSubmit()
{
foreach($_POST as $k => $v)
{
$scKey = strtoupper($k);
$scKey = strtoupper((string) $k);
$vars[$scKey] = $tp->toEmail($v, true, 'RAWTEXT');
}
}
Expand Down
42 changes: 21 additions & 21 deletions e107_admin/admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function loadEventTypes($table)
continue;
}
$id = $val['dblog_eventcode'];
$def = strpos($val['dblog_title'], "LAN") !== false ? $id : $val['dblog_title'];
$def = strpos((string) $val['dblog_title'], "LAN") !== false ? $id : $val['dblog_title'];
$eventTypes[$id] = str_replace(': [x]', '', deftrue($val['dblog_title'],$def));
}

Expand Down Expand Up @@ -336,7 +336,7 @@ function maintenanceProcess()
$action = '';

// print_a($_POST);

if(!empty($_POST['deleteoldadmin']) && isset($_POST['rolllog_clearadmin']))
{
$back_count = intval($_POST['rolllog_clearadmin']);
Expand Down Expand Up @@ -371,8 +371,8 @@ function maintenanceProcess()
*/

$old_date = strtotime($back_count.' days ago');


// Actually delete back events - admin or user audit log
if(($action == "backdel") && isset($_POST['backdeltype']))
{
Expand Down Expand Up @@ -418,7 +418,7 @@ function maintenanceProcess()
}

}

// Prompt to delete back events
/*
if(($action == "confdel") || ($action == "auditdel"))
Expand All @@ -442,12 +442,12 @@ function maintenanceProcess()
</div>
</fieldset>
</form>

";

$ns->tablerender(LAN_CONFDELETE, $text);
}

*/

}
Expand Down Expand Up @@ -615,24 +615,24 @@ function dblog_title($curVal,$mode)



$val = trim($curVal);
$val = trim((string) $curVal);
if(defined($val))
{
$val = constant($val);
}

if(strpos($val,'[x]') !== false)
if(strpos((string) $val,'[x]') !== false)
{
$remark = $this->getController()->getListModel()->get('dblog_remarks');
preg_match("/\[table\]\s=&gt;\s([\w]*)/i",$remark, $match);
preg_match("/\[table\]\s=&gt;\s([\w]*)/i",(string) $remark, $match);

if(!empty($match[1]))
{
$val = $tp->lanVars($val, '<b>'.$match[1].'</b>');
}
else
{
preg_match("/\[!br!\]TABLE: ([\w]*)/i", $remark, $m);
preg_match("/\[!br!\]TABLE: ([\w]*)/i", (string) $remark, $m);
if(!empty($m[1]))
{
$val = $tp->lanVars($val, '<b>'.$m[1].'</b>');
Expand Down Expand Up @@ -681,7 +681,7 @@ function dblog_remarks($curVal,$mode)
{
case 'read': // List Page

$text = preg_replace_callback("#\[!(\w+?)(=.+?)?!]#", 'log_process', $curVal);
$text = preg_replace_callback("#\[!(\w+?)(=.+?)?!]#", 'log_process', (string) $curVal);
$text = $tp->toHTML($text,false,'E_BODY');

if(strpos($text,'Array')!==false || strlen($text)>300)
Expand Down Expand Up @@ -727,9 +727,9 @@ function dblog_caller($curVal,$mode)
{
case 'read': // List Page
$val =$curVal;
if((strpos($val, '|') !== FALSE) && (strpos($val, '@') !== FALSE))
if((strpos((string) $val, '|') !== FALSE) && (strpos((string) $val, '@') !== FALSE))
{
list($file, $rest) = explode('|', $val);
list($file, $rest) = explode('|', (string) $val);
list($routine, $rest) = explode('@', $rest);
$val = $file.'<br />Function: '.$routine.'<br />Line: '.$rest;
}
Expand All @@ -750,15 +750,15 @@ function dblog_caller($curVal,$mode)

class audit_log_ui extends e_admin_ui
{

protected $pluginTitle = ADLAN_155;
protected $pluginName = 'core';
protected $table = 'audit_log';
protected $pid = 'dblog_id';
protected $perPage = 10;
protected $listOrder = 'dblog_id DESC';
protected $batchDelete = true;

protected $fields = array (
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
'dblog_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
Expand All @@ -772,9 +772,9 @@ class audit_log_ui extends e_admin_ui
'dblog_remarks' => array ( 'title' => 'Remarks', 'type' => 'method', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'nolist'=>true, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
);

protected $fieldpref = array('dblog_id', 'dblog_datestamp', 'dblog_microtime', 'dblog_eventcode', 'dblog_user_id', 'dblog_user_name', 'dblog_ip', 'dblog_title','dblog_remarks');

public $eventTypes = array();

// optional
Expand All @@ -791,7 +791,7 @@ public function customPage()
$ns = e107::getRender();
$text = 'Hello World!';
$ns->tablerender('Hello',$text);

}
*/

Expand Down Expand Up @@ -855,7 +855,7 @@ function log_process($matches)
case 'br':
return '<br />';
case 'link':
$temp = substr($matches[2], 1);
$temp = substr((string) $matches[2], 1);
return "<a href='{$temp}'>{$temp}</a>";
case 'test':
return '----TEST----';
Expand Down
Loading
Loading