From 168e96187d4e802d7c15426a7646da9b0045af56 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 22 Mar 2017 21:25:36 +0100 Subject: [PATCH] attempt two at "fixing" --- app/Forum/Post.php | 3 ++- app/User.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Forum/Post.php b/app/Forum/Post.php index 82db2f8..126120b 100644 --- a/app/Forum/Post.php +++ b/app/Forum/Post.php @@ -189,11 +189,12 @@ class Post { // Create a topic object $topic = new Topic($this->topic); + $ip = Net::pton("::1"); try { $ip = Net::pton($this->ip); } catch (NetAddressTypeException $e) { - $ip = Net::pton("::1"); + } catch (NetInvalidAddressException $e) { } // Update the post diff --git a/app/User.php b/app/User.php index 9688dd6..a0b2108 100644 --- a/app/User.php +++ b/app/User.php @@ -388,11 +388,12 @@ class User $this->registerIp = Net::ntop($userRow->register_ip); } catch (NetAddressTypeException $e) { $this->registerIp = $userRow->register_ip; + $reg_ip = Net::pton("::1"); try { $reg_ip = Net::pton($this->registerIp); } catch (NetAddressTypeException $e) { - $reg_ip = Net::pton("::1"); + } catch (NetInvalidAddressException $e) { } DB::table('users') @@ -406,11 +407,12 @@ class User $this->lastIp = Net::ntop($userRow->last_ip); } catch (NetAddressTypeException $e) { $this->lastIp = $userRow->last_ip; + $last_ip = Net::pton("::1"); try { $last_ip = Net::pton($this->lastIp); } catch (NetAddressTypeException $e) { - $last_ip = Net::pton("::1"); + } catch (NetInvalidAddressException $e) { } DB::table('users')