Merge pull request #4456 from MrPetovan/task/4176-fix-undeclared-variables-3

[Scrutinizer] Fix undeclared variables part 7: mod/ and view/
This commit is contained in:
Michael Vogel 2018-02-14 07:48:35 +01:00 committed by GitHub
commit af0e10ee20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 21 deletions

View file

@ -13,19 +13,6 @@ use Friendica\Util\Crypto;
require_once 'include/items.php'; require_once 'include/items.php';
function salmon_return($val) {
if($val >= 400)
$err = 'Error';
if($val >= 200 && $val < 300)
$err = 'OK';
logger('mod-salmon returns ' . $val);
header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err);
killme();
}
function salmon_post(App $a) { function salmon_post(App $a) {
$xml = file_get_contents('php://input'); $xml = file_get_contents('php://input');
@ -48,8 +35,9 @@ function salmon_post(App $a) {
$dom = simplexml_load_string($xml,'SimpleXMLElement',0,NAMESPACE_SALMON_ME); $dom = simplexml_load_string($xml,'SimpleXMLElement',0,NAMESPACE_SALMON_ME);
// figure out where in the DOM tree our data is hiding $base = null;
// figure out where in the DOM tree our data is hiding
if($dom->provenance->data) if($dom->provenance->data)
$base = $dom->provenance; $base = $dom->provenance;
elseif($dom->env->data) elseif($dom->env->data)

View file

@ -9,6 +9,7 @@ use Friendica\Model\Item;
function starred_init(App $a) { function starred_init(App $a) {
$starred = 0; $starred = 0;
$message_id = null;
if (! local_user()) { if (! local_user()) {
killme(); killme();

View file

@ -57,6 +57,7 @@ function subthread_content(App $a) {
} }
} }
$owner = null;
// this represents the post owner on this system. // this represents the post owner on this system.
$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid` $r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
@ -75,6 +76,7 @@ function subthread_content(App $a) {
$remote_owner = $owner; $remote_owner = $owner;
$contact = null;
// This represents the person posting // This represents the person posting
if ((local_user()) && (local_user() == $owner_uid)) { if ((local_user()) && (local_user() == $owner_uid)) {

View file

@ -141,6 +141,7 @@ function uexport_all(App $a) {
uexport_account($a); uexport_account($a);
echo "\n"; echo "\n";
$total = 0;
$r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ", $r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ",
intval(local_user()) intval(local_user())
); );

View file

@ -114,7 +114,10 @@ function wall_upload_post(App $a, $desktopmode = true) {
killme(); killme();
} }
$src = ""; $src = '';
$filename = '';
$filesize = 0;
$filetype = '';
if (x($_FILES, 'userfile')) { if (x($_FILES, 'userfile')) {
$src = $_FILES['userfile']['tmp_name']; $src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']); $filename = basename($_FILES['userfile']['name']);

View file

@ -217,6 +217,7 @@ function frio_remote_nav($a, &$nav)
// And construct a webbie (e.g. mickey@friendica.domain.com for the search in gcontact // And construct a webbie (e.g. mickey@friendica.domain.com for the search in gcontact
// We use the webbie for search in gcontact because we don't know if gcontact table stores // We use the webbie for search in gcontact because we don't know if gcontact table stores
// the right value if its http or https protocol // the right value if its http or https protocol
$webbie = '';
if (count($url_parts)) { if (count($url_parts)) {
$server_url = $url_parts[1] . $url_parts[2]; $server_url = $url_parts[1] . $url_parts[2];
$webbie = $url_parts[4] . '@' . $url_parts[2]; $webbie = $url_parts[4] . '@' . $url_parts[2];
@ -296,14 +297,9 @@ function frio_acl_lookup(App $a, &$results)
return; return;
} }
$searching = false; $sql_extra = '';
if ($results["search"]) { if ($results["search"]) {
$search_txt = dbesc(protect_sprintf(preg_quote($results["search"]))); $search_txt = dbesc(protect_sprintf(preg_quote($results["search"])));
$searching = true;
}
$sql_extra = '';
if ($searching) {
$sql_extra .= " AND (`attag` LIKE '%%" . dbesc($search_txt) . "%%' OR `name` LIKE '%%" . dbesc($search_txt) . "%%' OR `nick` LIKE '%%" . dbesc($search_txt) . "%%') "; $sql_extra .= " AND (`attag` LIKE '%%" . dbesc($search_txt) . "%%' OR `name` LIKE '%%" . dbesc($search_txt) . "%%' OR `nick` LIKE '%%" . dbesc($search_txt) . "%%') ";
} }
@ -311,6 +307,7 @@ function frio_acl_lookup(App $a, &$results)
$sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets)); $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
} }
$total = 0;
$r = q("SELECT COUNT(*) AS `total` FROM `contact` $r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND NOT `self` AND NOT `pending` $sql_extra ", intval($_SESSION['uid'])); WHERE `uid` = %d AND NOT `self` AND NOT `pending` $sql_extra ", intval($_SESSION['uid']));
if (DBM::is_result($r)) { if (DBM::is_result($r)) {

View file

@ -215,6 +215,7 @@ function vier_community_info()
//Community_Pages at right_aside //Community_Pages at right_aside
if ($show_pages && local_user()) { if ($show_pages && local_user()) {
$cid = null;
if (x($_GET, 'cid') && intval($_GET['cid']) != 0) { if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
$cid = $_GET['cid']; $cid = $_GET['cid'];
} }