]> git.mxchange.org Git - friendica.git/commitdiff
-Wall cleanup
authorMike Macgirvin <mike@macgirvin.com>
Sat, 30 Oct 2010 20:25:37 +0000 (13:25 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Sat, 30 Oct 2010 20:25:37 +0000 (13:25 -0700)
boot.php
include/auth.php
include/dba.php
index.php
mod/network.php
mod/ping.php
mod/profile.php
util/typo.php

index b67a6cebbea8c6ab7c393d7526fbb7af8e017058..6cac527eb5b94a8a6474ffc5ee1672e94c8a3bd0 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -129,12 +129,16 @@ class App {
                $this->pager= array();
 
                $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS']))      ?  'https' : 'http' );
-               $this->hostname = $_SERVER['SERVER_NAME'];
+
+               if(x($_SERVER,'SERVER_NAME'))
+                       $this->hostname = $_SERVER['SERVER_NAME'];
+
                set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
 
-               if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
+               if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) == "q=")
                        $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
-               $this->cmd = trim($_GET['q'],'/');
+               if(x($_GET,'q'))
+                       $this->cmd = trim($_GET['q'],'/');
 
 
                $this->argv = explode('/',$this->cmd);
@@ -1226,6 +1230,7 @@ function allowed_email($email) {
 
 if(! function_exists('format_like')) {
 function format_like($cnt,$arr,$type,$id) {
+       $o = '';
        if($cnt == 1)
                $o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
        else {
index a54b24f085cdb7f35f054fe4e04313acd83af8cb..4813bb45bd70cf75098e4eae65c98ed4e9fa14ad 100644 (file)
@@ -2,7 +2,7 @@
 
 // login/logout 
 
-if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
+if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
 
        if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
        
@@ -53,16 +53,19 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
 }
 else {
 
-       unset($_SESSION['authenticated']);
-       unset($_SESSION['uid']);
-       unset($_SESSION['visitor_id']);
-       unset($_SESSION['administrator']);
-       unset($_SESSION['cid']);
-       unset($_SESSION['theme']);
-       unset($_SESSION['my_url']);
-       unset($_SESSION['page_flags']);
+       if(isset($_SESSION)) {
+               unset($_SESSION['authenticated']);
+               unset($_SESSION['uid']);
+               unset($_SESSION['visitor_id']);
+               unset($_SESSION['administrator']);
+               unset($_SESSION['cid']);
+               unset($_SESSION['theme']);
+               unset($_SESSION['my_url']);
+               unset($_SESSION['page_flags']);
+       }
 
-       $encrypted = hash('whirlpool',trim($_POST['password']));
+       if(x($_POST,'password'))
+               $encrypted = hash('whirlpool',trim($_POST['password']));
 
        if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
 
index 133b596efa6b51a1e10ebc90cde6a4d30d19c5e1..9d0896a354e4131a7a21056e189a851d9d1f5772 100644 (file)
@@ -36,8 +36,8 @@ class dba {
 
                        $mesg = '';
 
-                       if($this->db->mysqli->errno)
-                               $debug_text .=  $this->db->mysqli->error . EOL;
+                       if($this->db->errno)
+                               $debug_text .=  $this->db->error . EOL;
 
                        if($result === false)
                                $mesg = 'false';
index 0a089106b91fd5304d557f4fe3b8a47ff93710e8..81d089dfb3aa4ed2cfcc6ce8f9f0fc275d31b416 100644 (file)
--- a/index.php
+++ b/index.php
@@ -12,7 +12,7 @@ $install = ((file_exists('.htconfig.php')) ? false : true);
 
 @include(".htconfig.php");
 
-if(x($lang))
+if(isset($lang) && strlen($lang))
        load_translation_table($lang);
 
 require_once("dba.php");
index 426ad196c642224cc6722cf981ce3cfbbb62ead5..cbd8b6bc32399aaa1ec16597abb557add2500d0e 100644 (file)
@@ -173,7 +173,7 @@ function network_content(&$a, $update = 0) {
                        $comment = '';
                        $template = $tpl;
                        $commentww = '';
-
+                       $owner_url = $owner_photo = $owner_name = '';
                        $profile_url = $item['url'];
                        $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
 
index 731562cd1a973b127a8e5f1b163c03f0188e4abf..0831e57bfa723bca2e84e09f6bb593feae110c6e 100644 (file)
@@ -25,7 +25,7 @@ function ping_init(&$a) {
        );
        $intro = $r[0]['total'];
 
-       $myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
+       $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
        $r = q("SELECT COUNT(*) AS `total` FROM `mail`
                WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
                intval(local_user()),
index 7c01501d66c4711f5977aafd98fb08cdc3da3f43..3ab77a0940ef9efc5728dbfbacf3145530897ad0 100644 (file)
@@ -85,7 +85,7 @@ function profile_content(&$a, $update = 0) {
        $groups = array();
 
        $tab = 'posts';
-
+       $o = '';
 
        if($update) {
                // Ensure we've got a profile owner if updating.
@@ -256,7 +256,6 @@ function profile_content(&$a, $update = 0) {
 
        );
 
-
        $cmnt_tpl = load_view_file('view/comment_item.tpl');
 
        $like_tpl = load_view_file('view/like.tpl');
index e3141a46e2f7715084ee3f313dda2605eb8c883d..67fa7dc90d2c77f77f39180d17c4bed5a4182b3f 100644 (file)
@@ -5,6 +5,11 @@
 
        include 'boot.php';
 
+       error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
+       ini_set('display_errors', '1');
+       ini_set('log_errors','0');
+
+
        $a = new App();
 
        $files = glob('mod/*.php');