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')