php: remove trailing whitespaces

This commit is contained in:
Andrew Dolgov 2018-11-03 15:08:43 +03:00
parent 3b9f982ec6
commit 3a0292303e
11 changed files with 56 additions and 56 deletions

View File

@ -126,7 +126,7 @@ class Article extends Handler_Protected {
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) return false; if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) return false;
$pdo = Db::pdo(); $pdo = Db::pdo();
$pdo->beginTransaction(); $pdo->beginTransaction();
// only check for our user data here, others might have shared this with different content etc // only check for our user data here, others might have shared this with different content etc
@ -309,7 +309,7 @@ class Article extends Handler_Protected {
if ($tag != '') { if ($tag != '') {
$sth = $this->pdo->prepare("INSERT INTO ttrss_tags $sth = $this->pdo->prepare("INSERT INTO ttrss_tags
(post_int_id, owner_uid, tag_name) (post_int_id, owner_uid, tag_name)
VALUES (?, ?, ?)"); VALUES (?, ?, ?)");
$sth->execute([$int_id, $_SESSION['uid'], $tag]); $sth->execute([$int_id, $_SESSION['uid'], $tag]);
@ -642,7 +642,7 @@ class Article extends Handler_Protected {
stylesheet_tag("css/default.css")." stylesheet_tag("css/default.css")."
<link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\"> <link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
<link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">"; <link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">";
$rv['content'] .= "<meta property=\"og:title\" content=\"".htmlspecialchars($line["title"])."\"/>\n"; $rv['content'] .= "<meta property=\"og:title\" content=\"".htmlspecialchars($line["title"])."\"/>\n";
$rv['content'] .= "<meta property=\"og:site_name\" content=\"".htmlspecialchars($line["feed_title"])."\"/>\n"; $rv['content'] .= "<meta property=\"og:site_name\" content=\"".htmlspecialchars($line["feed_title"])."\"/>\n";
$rv['content'] .= "<meta property=\"og:description\" content=\"". $rv['content'] .= "<meta property=\"og:description\" content=\"".
@ -829,7 +829,7 @@ class Article extends Handler_Protected {
$pdo = Db::pdo(); $pdo = Db::pdo();
$sth = $pdo->prepare("SELECT DISTINCT tag_name, $sth = $pdo->prepare("SELECT DISTINCT tag_name,
owner_uid as owner FROM ttrss_tags owner_uid as owner FROM ttrss_tags
WHERE post_int_id = (SELECT int_id FROM ttrss_user_entries WHERE WHERE post_int_id = (SELECT int_id FROM ttrss_user_entries WHERE
ref_id = ? AND owner_uid = ? LIMIT 1) ORDER BY tag_name"); ref_id = ? AND owner_uid = ? LIMIT 1) ORDER BY tag_name");

View File

@ -130,7 +130,7 @@ class CCache {
if (!$pcat_fast) { if (!$pcat_fast) {
$sth = $pdo->prepare("SELECT id FROM ttrss_feeds $sth = $pdo->prepare("SELECT id FROM ttrss_feeds
WHERE owner_uid = :uid AND WHERE owner_uid = :uid AND
(cat_id = :cat OR (:cat = 0 AND cat_id IS NULL))"); (cat_id = :cat OR (:cat = 0 AND cat_id IS NULL))");
$sth->execute([":uid" => $owner_uid, ":cat" => $feed_id]); $sth->execute([":uid" => $owner_uid, ":cat" => $feed_id]);
@ -141,7 +141,7 @@ class CCache {
$sth = $pdo->prepare("SELECT SUM(value) AS sv $sth = $pdo->prepare("SELECT SUM(value) AS sv
FROM ttrss_counters_cache, ttrss_feeds FROM ttrss_counters_cache, ttrss_feeds
WHERE id = feed_id AND WHERE id = feed_id AND
(cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)) AND (cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)) AND
ttrss_counters_cache.owner_uid = :uid AND ttrss_counters_cache.owner_uid = :uid AND
ttrss_feeds.owner_uid = :uid"); ttrss_feeds.owner_uid = :uid");

View File

@ -173,7 +173,7 @@ class Feeds extends Handler_Protected {
$method_split = explode(":", $method); $method_split = explode(":", $method);
if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) { if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) {
$sth = $this->pdo->prepare("UPDATE ttrss_feeds $sth = $this->pdo->prepare("UPDATE ttrss_feeds
SET last_updated = '1970-01-01', last_update_started = '1970-01-01' SET last_updated = '1970-01-01', last_update_started = '1970-01-01'
WHERE id = ?"); WHERE id = ?");
$sth->execute([$feed]); $sth->execute([$feed]);
@ -527,7 +527,7 @@ class Feeds extends Handler_Protected {
$tmp_content .= "<span id=\"RTITLE-$id\" $tmp_content .= "<span id=\"RTITLE-$id\"
onclick=\"return cdmClicked(event, $id);\" onclick=\"return cdmClicked(event, $id);\"
data-article-id=\"$id\" data-article-id=\"$id\"
class=\"titleWrap hlMenuAttach $hlc_suffix\"> class=\"titleWrap hlMenuAttach $hlc_suffix\">
<a class=\"title $hlc_suffix\" <a class=\"title $hlc_suffix\"
title=\"".htmlspecialchars($line["title"])."\" title=\"".htmlspecialchars($line["title"])."\"
target=\"_blank\" rel=\"noopener noreferrer\" href=\"". target=\"_blank\" rel=\"noopener noreferrer\" href=\"".
@ -1471,7 +1471,7 @@ class Feeds extends Handler_Protected {
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
} }
if (!$contents) { if (!$contents) {
if (preg_match("/cloudflare\.com/", $fetch_last_error_content)) { if (preg_match("/cloudflare\.com/", $fetch_last_error_content)) {
$fetch_last_error .= " (feed behind Cloudflare)"; $fetch_last_error .= " (feed behind Cloudflare)";

View File

@ -42,7 +42,7 @@ class Labels
$pdo = Db::pdo(); $pdo = Db::pdo();
$sth = $pdo->prepare("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2 $sth = $pdo->prepare("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2
WHERE owner_uid = ? ORDER BY caption"); WHERE owner_uid = ? ORDER BY caption");
$sth->execute([$owner_uid]); $sth->execute([$owner_uid]);
@ -190,7 +190,7 @@ class Labels
$sth->execute([$caption, $owner_uid]); $sth->execute([$caption, $owner_uid]);
if (!$sth->fetch()) { if (!$sth->fetch()) {
$sth = $pdo->prepare("INSERT INTO ttrss_labels2 $sth = $pdo->prepare("INSERT INTO ttrss_labels2
(caption,owner_uid,fg_color,bg_color) VALUES (?, ?, ?, ?)"); (caption,owner_uid,fg_color,bg_color) VALUES (?, ?, ?, ?)");
$sth->execute([$caption, $owner_uid, $fg_color, $bg_color]); $sth->execute([$caption, $owner_uid, $fg_color, $bg_color]);

View File

@ -75,7 +75,7 @@ class Opml extends Handler_Protected {
$sth = $this->pdo->prepare("SELECT id,title $sth = $this->pdo->prepare("SELECT id,title
FROM ttrss_feed_categories WHERE FROM ttrss_feed_categories WHERE
(parent_cat = :cat OR (:cat = 0 AND parent_cat IS NULL)) AND (parent_cat = :cat OR (:cat = 0 AND parent_cat IS NULL)) AND
owner_uid = :uid ORDER BY order_id, title"); owner_uid = :uid ORDER BY order_id, title");
$sth->execute([':cat' => $cat_id, ':uid' => $owner_uid]); $sth->execute([':cat' => $cat_id, ':uid' => $owner_uid]);
@ -85,7 +85,7 @@ class Opml extends Handler_Protected {
} }
$fsth = $this->pdo->prepare("select title, feed_url, site_url $fsth = $this->pdo->prepare("select title, feed_url, site_url
FROM ttrss_feeds WHERE FROM ttrss_feeds WHERE
(cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)) AND owner_uid = :uid AND $hide_qpart (cat_id = :cat OR (:cat = 0 AND cat_id IS NULL)) AND owner_uid = :uid AND $hide_qpart
ORDER BY order_id, title"); ORDER BY order_id, title");
@ -421,9 +421,9 @@ class Opml extends Handler_Protected {
$inverse = bool_to_sql_bool($rule["inverse"]); $inverse = bool_to_sql_bool($rule["inverse"]);
$match_on = json_encode($match_on); $match_on = json_encode($match_on);
$usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_rules $usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_rules
(feed_id,cat_id,match_on,filter_id,filter_type,reg_exp,cat_filter,inverse) (feed_id,cat_id,match_on,filter_id,filter_type,reg_exp,cat_filter,inverse)
VALUES VALUES
(NULL, NULL, ?, ?, ?, ?, false, ?)"); (NULL, NULL, ?, ?, ?, ?, false, ?)");
$usth->execute([$match_on, $filter_id, $filter_type, $reg_exp, $inverse]); $usth->execute([$match_on, $filter_id, $filter_type, $reg_exp, $inverse]);
@ -454,9 +454,9 @@ class Opml extends Handler_Protected {
$filter_type = (int)$rule["filter_type"]; $filter_type = (int)$rule["filter_type"];
$inverse = bool_to_sql_bool($rule["inverse"]); $inverse = bool_to_sql_bool($rule["inverse"]);
$usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_rules $usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_rules
(feed_id,cat_id,filter_id,filter_type,reg_exp,cat_filter,inverse) (feed_id,cat_id,filter_id,filter_type,reg_exp,cat_filter,inverse)
VALUES VALUES
(?, ?, ?, ?, ?, ?, ?)"); (?, ?, ?, ?, ?, ?, ?)");
$usth->execute([$feed_id, $cat_id, $filter_id, $filter_type, $reg_exp, $cat_filter, $inverse]); $usth->execute([$feed_id, $cat_id, $filter_id, $filter_type, $reg_exp, $cat_filter, $inverse]);
} }
@ -467,9 +467,9 @@ class Opml extends Handler_Protected {
$action_id = (int)$action["action_id"]; $action_id = (int)$action["action_id"];
$action_param = $action["action_param"]; $action_param = $action["action_param"];
$usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_actions $usth = $this->pdo->prepare("INSERT INTO ttrss_filters2_actions
(filter_id,action_id,action_param) (filter_id,action_id,action_param)
VALUES VALUES
(?, ?, ?)"); (?, ?, ?)");
$usth->execute([$filter_id, $action_id, $action_param]); $usth->execute([$filter_id, $action_id, $action_param]);
} }
@ -613,7 +613,7 @@ class Opml extends Handler_Protected {
$parent_cat_id = (int) $parent_cat_id; $parent_cat_id = (int) $parent_cat_id;
$sth = $this->pdo->prepare("SELECT id FROM ttrss_feed_categories $sth = $this->pdo->prepare("SELECT id FROM ttrss_feed_categories
WHERE title = :title WHERE title = :title
AND (parent_cat = :parent OR (:parent = 0 AND parent_cat IS NULL)) AND (parent_cat = :parent OR (:parent = 0 AND parent_cat IS NULL))
AND owner_uid = :uid"); AND owner_uid = :uid");

View File

@ -96,7 +96,7 @@ class PluginHost {
function get_pdo() { function get_pdo() {
return $this->pdo; return $this->pdo;
} }
function get_plugin_names() { function get_plugin_names() {
$names = array(); $names = array();

View File

@ -71,7 +71,7 @@ class Pref_Feeds extends Handler_Protected {
$fsth = $this->pdo->prepare("SELECT id, title, last_error, $fsth = $this->pdo->prepare("SELECT id, title, last_error,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
FROM ttrss_feeds FROM ttrss_feeds
WHERE cat_id = :cat AND WHERE cat_id = :cat AND
owner_uid = :uid AND owner_uid = :uid AND
(:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search)) (:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search))
ORDER BY order_id, title"); ORDER BY order_id, title");
@ -238,9 +238,9 @@ class Pref_Feeds extends Handler_Protected {
$cat['child_unread'] = 0; $cat['child_unread'] = 0;
$fsth = $this->pdo->prepare("SELECT id, title,last_error, $fsth = $this->pdo->prepare("SELECT id, title,last_error,
".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated, update_interval
FROM ttrss_feeds FROM ttrss_feeds
WHERE cat_id IS NULL AND WHERE cat_id IS NULL AND
owner_uid = :uid AND owner_uid = :uid AND
(:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search)) (:search = '' OR (LOWER(title) LIKE :search OR LOWER(feed_url) LIKE :search))
ORDER BY order_id, title"); ORDER BY order_id, title");
@ -745,7 +745,7 @@ class Pref_Feeds extends Handler_Protected {
</label> </label>
<input type=\"hidden\" name=\"op\" value=\"pref-feeds\"> <input type=\"hidden\" name=\"op\" value=\"pref-feeds\">
<input type=\"hidden\" name=\"feed_id\" value=\"$feed_id\"> <input type=\"hidden\" name=\"feed_id\" value=\"$feed_id\">
<input type=\"hidden\" name=\"method\" value=\"uploadicon\"> <input type=\"hidden\" name=\"method\" value=\"uploadicon\">
<button class=\"\" dojoType=\"dijit.form.Button\" onclick=\"return uploadFeedIcon();\" <button class=\"\" dojoType=\"dijit.form.Button\" onclick=\"return uploadFeedIcon();\"
type=\"submit\">".__('Replace')."</button> type=\"submit\">".__('Replace')."</button>
<button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick=\"return removeFeedIcon($feed_id);\" <button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick=\"return removeFeedIcon($feed_id);\"
@ -969,7 +969,7 @@ class Pref_Feeds extends Handler_Protected {
$sth = $this->pdo->prepare("UPDATE ttrss_feeds SET $sth = $this->pdo->prepare("UPDATE ttrss_feeds SET
cat_id = :cat_id, cat_id = :cat_id,
title = :title, title = :title,
feed_url = :feed_url, feed_url = :feed_url,
site_url = :site_url, site_url = :site_url,
update_interval = :upd_intl, update_interval = :upd_intl,

View File

@ -170,12 +170,12 @@ class Pref_Users extends Handler_Protected {
} }
print "</ul>"; print "</ul>";
} else { } else {
print "<h1>".__('User not found')."</h1>"; print "<h1>".__('User not found')."</h1>";
} }
} }
function editSave() { function editSave() {
@ -188,7 +188,7 @@ class Pref_Users extends Handler_Protected {
if ($password) { if ($password) {
$salt = substr(bin2hex(get_random_bytes(125)), 0, 250); $salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
$pwd_hash = encrypt_password($password, $salt, true); $pwd_hash = encrypt_password($password, $salt, true);
$pass_query_part = "pwd_hash = ".$this->pdo->quote($pwd_hash).", $pass_query_part = "pwd_hash = ".$this->pdo->quote($pwd_hash).",
salt = ".$this->pdo->quote($salt).","; salt = ".$this->pdo->quote($salt).",";
} else { } else {
$pass_query_part = ""; $pass_query_part = "";
@ -265,7 +265,7 @@ class Pref_Users extends Handler_Protected {
$sth = $pdo->prepare("SELECT login, email $sth = $pdo->prepare("SELECT login, email
FROM ttrss_users WHERE id = ?"); FROM ttrss_users WHERE id = ?");
$sth->execute([$uid]); $sth->execute([$uid]);
if ($row = $sth->fetch()) { if ($row = $sth->fetch()) {
$login = $row["login"]; $login = $row["login"];
@ -276,7 +276,7 @@ class Pref_Users extends Handler_Protected {
$pwd_hash = encrypt_password($tmp_user_pwd, $new_salt, true); $pwd_hash = encrypt_password($tmp_user_pwd, $new_salt, true);
$sth = $pdo->prepare("UPDATE ttrss_users $sth = $pdo->prepare("UPDATE ttrss_users
SET pwd_hash = ?, salt = ?, otp_enabled = false SET pwd_hash = ?, salt = ?, otp_enabled = false
WHERE id = ?"); WHERE id = ?");
$sth->execute([$pwd_hash, $new_salt, $uid]); $sth->execute([$pwd_hash, $new_salt, $uid]);
@ -313,7 +313,7 @@ class Pref_Users extends Handler_Protected {
if (!$rc) print_error($mail->ErrorInfo); if (!$rc) print_error($mail->ErrorInfo);
} }
} }
} }

View File

@ -168,7 +168,7 @@ class Mail extends Plugin {
print "</td></tr>"; print "</td></tr>";
print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\" print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\"
style='height : 200px; font-size : 12px; width : 98%' rows=\"20\" style='height : 200px; font-size : 12px; width : 98%' rows=\"20\"
name='content'>$content</textarea>"; name='content'>$content</textarea>";

View File

@ -124,7 +124,7 @@ define ( "SPH_GROUPBY_ATTRPAIR", 5 );
function sphPackI64 ( $v ) function sphPackI64 ( $v )
{ {
assert ( is_numeric($v) ); assert ( is_numeric($v) );
// x64 // x64
if ( PHP_INT_SIZE>=8 ) if ( PHP_INT_SIZE>=8 )
{ {
@ -136,7 +136,7 @@ function sphPackI64 ( $v )
if ( is_int($v) ) if ( is_int($v) )
return pack ( "NN", $v < 0 ? -1 : 0, $v ); return pack ( "NN", $v < 0 ? -1 : 0, $v );
// x32, bcmath // x32, bcmath
if ( function_exists("bcmul") ) if ( function_exists("bcmul") )
{ {
if ( bccomp ( $v, 0 ) == -1 ) if ( bccomp ( $v, 0 ) == -1 )
@ -173,16 +173,16 @@ function sphPackI64 ( $v )
function sphPackU64 ( $v ) function sphPackU64 ( $v )
{ {
assert ( is_numeric($v) ); assert ( is_numeric($v) );
// x64 // x64
if ( PHP_INT_SIZE>=8 ) if ( PHP_INT_SIZE>=8 )
{ {
assert ( $v>=0 ); assert ( $v>=0 );
// x64, int // x64, int
if ( is_int($v) ) if ( is_int($v) )
return pack ( "NN", $v>>32, $v&0xFFFFFFFF ); return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
// x64, bcmath // x64, bcmath
if ( function_exists("bcmul") ) if ( function_exists("bcmul") )
{ {
@ -190,12 +190,12 @@ function sphPackU64 ( $v )
$l = bcmod ( $v, 4294967296 ); $l = bcmod ( $v, 4294967296 );
return pack ( "NN", $h, $l ); return pack ( "NN", $h, $l );
} }
// x64, no-bcmath // x64, no-bcmath
$p = max ( 0, strlen($v) - 13 ); $p = max ( 0, strlen($v) - 13 );
$lo = (int)substr ( $v, $p ); $lo = (int)substr ( $v, $p );
$hi = (int)substr ( $v, 0, $p ); $hi = (int)substr ( $v, 0, $p );
$m = $lo + $hi*1316134912; $m = $lo + $hi*1316134912;
$l = $m % 4294967296; $l = $m % 4294967296;
$h = $hi*2328 + (int)($m/4294967296); $h = $hi*2328 + (int)($m/4294967296);
@ -206,7 +206,7 @@ function sphPackU64 ( $v )
// x32, int // x32, int
if ( is_int($v) ) if ( is_int($v) )
return pack ( "NN", 0, $v ); return pack ( "NN", 0, $v );
// x32, bcmath // x32, bcmath
if ( function_exists("bcmul") ) if ( function_exists("bcmul") )
{ {
@ -219,7 +219,7 @@ function sphPackU64 ( $v )
$p = max(0, strlen($v) - 13); $p = max(0, strlen($v) - 13);
$lo = (float)substr($v, $p); $lo = (float)substr($v, $p);
$hi = (float)substr($v, 0, $p); $hi = (float)substr($v, 0, $p);
$m = $lo + $hi*1316134912.0; $m = $lo + $hi*1316134912.0;
$q = floor($m / 4294967296.0); $q = floor($m / 4294967296.0);
$l = $m - ($q * 4294967296.0); $l = $m - ($q * 4294967296.0);
@ -275,11 +275,11 @@ function sphUnpackU64 ( $v )
// x32, bcmath // x32, bcmath
if ( function_exists("bcmul") ) if ( function_exists("bcmul") )
return bcadd ( $lo, bcmul ( $hi, "4294967296" ) ); return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
// x32, no-bcmath // x32, no-bcmath
$hi = (float)$hi; $hi = (float)$hi;
$lo = (float)$lo; $lo = (float)$lo;
$q = floor($hi/10000000.0); $q = floor($hi/10000000.0);
$r = $hi - $q*10000000.0; $r = $hi - $q*10000000.0;
$m = $lo + $r*4967296.0; $m = $lo + $r*4967296.0;
@ -322,7 +322,7 @@ function sphUnpackI64 ( $v )
return $lo; return $lo;
return sprintf ( "%.0f", $lo - 4294967296.0 ); return sprintf ( "%.0f", $lo - 4294967296.0 );
} }
$neg = ""; $neg = "";
$c = 0; $c = 0;
if ( $hi<0 ) if ( $hi<0 )
@ -331,7 +331,7 @@ function sphUnpackI64 ( $v )
$lo = ~$lo; $lo = ~$lo;
$c = 1; $c = 1;
$neg = "-"; $neg = "-";
} }
$hi = sprintf ( "%u", $hi ); $hi = sprintf ( "%u", $hi );
$lo = sprintf ( "%u", $lo ); $lo = sprintf ( "%u", $lo );
@ -343,7 +343,7 @@ function sphUnpackI64 ( $v )
// x32, no-bcmath // x32, no-bcmath
$hi = (float)$hi; $hi = (float)$hi;
$lo = (float)$lo; $lo = (float)$lo;
$q = floor($hi/10000000.0); $q = floor($hi/10000000.0);
$r = $hi - $q*10000000.0; $r = $hi - $q*10000000.0;
$m = $lo + $r*4967296.0; $m = $lo + $r*4967296.0;
@ -506,7 +506,7 @@ class SphinxClient
$this->_path = $host; $this->_path = $host;
return; return;
} }
assert ( is_int($port) ); assert ( is_int($port) );
$this->_host = $host; $this->_host = $host;
$this->_port = $port; $this->_port = $port;
@ -586,14 +586,14 @@ class SphinxClient
$fp = @fsockopen ( $host, $port, $errno, $errstr ); $fp = @fsockopen ( $host, $port, $errno, $errstr );
else else
$fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout ); $fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout );
if ( !$fp ) if ( !$fp )
{ {
if ( $this->_path ) if ( $this->_path )
$location = $this->_path; $location = $this->_path;
else else
$location = "{$this->_host}:{$this->_port}"; $location = "{$this->_host}:{$this->_port}";
$errstr = trim ( $errstr ); $errstr = trim ( $errstr );
$this->_error = "connection to $location failed (errno=$errno, msg=$errstr)"; $this->_error = "connection to $location failed (errno=$errno, msg=$errstr)";
$this->_connerror = true; $this->_connerror = true;
@ -1231,7 +1231,7 @@ class SphinxClient
if ( $type==SPH_ATTR_FLOAT ) if ( $type==SPH_ATTR_FLOAT )
{ {
list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4; list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
list(,$fval) = unpack ( "f*", pack ( "L", $uval ) ); list(,$fval) = unpack ( "f*", pack ( "L", $uval ) );
$attrvals[$attr] = $fval; $attrvals[$attr] = $fval;
continue; continue;
} }
@ -1250,7 +1250,7 @@ class SphinxClient
} else if ( $type==SPH_ATTR_STRING ) } else if ( $type==SPH_ATTR_STRING )
{ {
$attrvals[$attr] = substr ( $response, $p, $val ); $attrvals[$attr] = substr ( $response, $p, $val );
$p += $val; $p += $val;
} else } else
{ {
$attrvals[$attr] = sphFixUint($val); $attrvals[$attr] = sphFixUint($val);
@ -1617,7 +1617,7 @@ class SphinxClient
fclose ( $this->_socket ); fclose ( $this->_socket );
$this->_socket = false; $this->_socket = false;
return true; return true;
} }

View File

@ -25,7 +25,7 @@ class VF_Shared extends Plugin {
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
function get_unread($feed_id) { function get_unread($feed_id) {
$sth = $this->pdo->prepare("select count(int_id) AS count $sth = $this->pdo->prepare("select count(int_id) AS count
from ttrss_user_entries where owner_uid = ? and unread = true and uuid != ''"); from ttrss_user_entries where owner_uid = ? and unread = true and uuid != ''");
$sth->execute([$_SESSION['uid']]); $sth->execute([$_SESSION['uid']]);
@ -40,7 +40,7 @@ class VF_Shared extends Plugin {
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
function get_total($feed_id) { function get_total($feed_id) {
$sth = $this->pdo->prepare("select count(int_id) AS count $sth = $this->pdo->prepare("select count(int_id) AS count
from ttrss_user_entries where owner_uid = ? and uuid != ''"); from ttrss_user_entries where owner_uid = ? and uuid != ''");
$sth->execute([$_SESSION['uid']]); $sth->execute([$_SESSION['uid']]);