Fixed parser errors (opps) + changed # -> // Please do so also as # for comments is deprecated.

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Haeder 2016-12-23 20:09:10 +01:00
parent 370571845b
commit 7aa799a0ee
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
4 changed files with 32 additions and 35 deletions

View file

@ -478,7 +478,7 @@ function service_class_allows($uid,$property,$usage = false) {
} }
} }
if (! x($service_class)) [ if (! x($service_class)) {
// everything is allowed // everything is allowed
return true; return true;
} }

View file

@ -123,15 +123,17 @@ class b8_storage_frndc extends b8_storage_base
function __destruct() function __destruct()
{ {
if($this->_connection === NULL) if ($this->_connection === NULL) {
return; return;
}
# Commit any changes before closing // Commit any changes before closing
$this->_commit(); $this->_commit();
# Just close the connection if no link-resource was passed and b8 created it's own connection // Just close the connection if no link-resource was passed and b8 created it's own connection
if($this->config['connection'] === NULL) if ($this->config['connection'] === NULL) {
mysql_close($this->_connection); mysql_close($this->_connection);
}
$this->connected = FALSE; $this->connected = FALSE;
@ -163,9 +165,8 @@ class b8_storage_frndc extends b8_storage_base
protected function _get_query($tokens, $uid) protected function _get_query($tokens, $uid)
{ {
# Construct the query ... // Construct the query ...
if (count($tokens) > 0) {
if(count($tokens) > 0) {
$where = array(); $where = array();
@ -175,42 +176,42 @@ class b8_storage_frndc extends b8_storage_base
} }
$where = 'term IN ("' . implode('", "', $where) . '")'; $where = 'term IN ("' . implode('", "', $where) . '")';
} } else {
else {
$token = dbesc($token); $token = dbesc($token);
$where = 'term = "' . $token . '"'; $where = 'term = "' . $token . '"';
} }
# ... and fetch the data // ... and fetch the data
$result = q(' $result = q('SELECT * FROM `spam` WHERE ' . $where . ' AND `uid` = ' . $uid );
SELECT * FROM spam WHERE ' . $where . ' AND uid = ' . $uid );
$returned_tokens = array(); $returned_tokens = array();
if(count($result)) { if (dbm::is_result($result)) {
foreach($result as $rr) foreach ($result as $rr) {
$returned_tokens[] = $rr['term']; $returned_tokens[] = $rr['term'];
}
} }
$to_create = array(); $to_create = array();
if(count($tokens) > 0) { if (count($tokens) > 0) {
foreach($tokens as $token) foreach($tokens as $token)
if(! in_array($token,$returned_tokens)) if(! in_array($token,$returned_tokens))
$to_create[] = str_tolower($token); $to_create[] = str_tolower($token);
} }
if(count($to_create)) { if (count($to_create)) {
$sql = ''; $sql = '';
foreach($to_create as $term) { foreach ($to_create as $term) {
if(strlen($sql)) if (strlen($sql)) {
$sql .= ','; $sql .= ',';
$sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)", }
dbesc(str_tolower($term)) $sql .= sprintf("(`term`,`datetime`,`uid`) VALUES('%s','%s',%d)",
dbesc(str_tolower($term)),
dbesc(datetime_convert()), dbesc(datetime_convert()),
intval($uid) intval($uid)
); );
q("insert into spam " . $sql); }
q("INSERT INTO `spam` " . $sql);
} }
return $result; return $result;
@ -225,7 +226,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $count * @param string $count
* @return void * @return void
*/ */
protected function _put($token, $count, $uid) { protected function _put($token, $count, $uid) {
$token = dbesc($token); $token = dbesc($token);
$count = dbesc($count); $count = dbesc($count);
@ -241,7 +241,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $count * @param string $count
* @return void * @return void
*/ */
protected function _update($token, $count, $uid) protected function _update($token, $count, $uid)
{ {
$token = dbesc($token); $token = dbesc($token);
@ -257,7 +256,6 @@ class b8_storage_frndc extends b8_storage_base
* @param string $token * @param string $token
* @return void * @return void
*/ */
protected function _del($token, $uid) protected function _del($token, $uid)
{ {
$token = dbesc($token); $token = dbesc($token);
@ -272,7 +270,6 @@ class b8_storage_frndc extends b8_storage_base
* @access protected * @access protected
* @return void * @return void
*/ */
protected function _commit($uid) protected function _commit($uid)
{ {
@ -314,5 +311,3 @@ class b8_storage_frndc extends b8_storage_base
} }
} }
?>

View file

@ -1854,9 +1854,9 @@ function admin_page_logs_post(App &$a) {
if (x($_POST,"page_logs")) { if (x($_POST,"page_logs")) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs'); check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
$logfile = (x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : ''); $logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
$debugging = ((x($_POST,'debugging')) ? true : false); $debugging = ((x($_POST,'debugging')) ? true : false);
$loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0); $loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0);
set_config('system','logfile', $logfile); set_config('system','logfile', $logfile);
set_config('system','debugging', $debugging); set_config('system','debugging', $debugging);

View file

@ -41,14 +41,15 @@ function profile_init(App &$a) {
if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) { if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
$a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />'; $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
} }
if(x($a->profile,'openidserver')) if (x($a->profile,'openidserver')) {
$a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
if(x($a->profile,'openid')) { }
if (x($a->profile,'openid')) {
$delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'https://' . $a->profile['openid']); $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'https://' . $a->profile['openid']);
$a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
} }
// site block // site block
if((! $blocked) && (! $userblock)) { if ((! $blocked) && (! $userblock)) {
$keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : ''); $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
$keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords); $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
if(strlen($keywords)) if(strlen($keywords))
@ -81,6 +82,7 @@ function profile_content(&$a, $update = 0) {
$datequery2 = escape_tags($a->argv[$x]); $datequery2 = escape_tags($a->argv[$x]);
} else { } else {
$datequery = escape_tags($a->argv[$x]); $datequery = escape_tags($a->argv[$x]);
}
} else { } else {
$category = $a->argv[$x]; $category = $a->argv[$x];
} }