diff --git a/src/application/controller/api/follow/get.php b/src/application/controller/api/follow/get.php index 5a35e5e..b10e713 100644 --- a/src/application/controller/api/follow/get.php +++ b/src/application/controller/api/follow/get.php @@ -9,7 +9,7 @@ $response = [ if (isset($_SESSION['userName'])) { - $userName = isset($_POST['userName']) ? $_POST['userName'] : $_SESSION['userName']; + $userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName']; $followingUsersTotal = 0; $followingUsers = []; diff --git a/src/application/controller/api/user/avatar.php b/src/application/controller/api/user/avatar.php index d8891ca..ac2aaf0 100644 --- a/src/application/controller/api/user/avatar.php +++ b/src/application/controller/api/user/avatar.php @@ -8,7 +8,7 @@ $response = [ if (isset($_SESSION['userName'])) { - $userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName']; + $userName = isset($_GET['userName']) ? Filter::userName($_GET['userName']) : $_SESSION['userName']; if ($avatarVersions = $_twister->getDHT($userName, 'avatar', 's')) { diff --git a/src/application/controller/api/user/profile.php b/src/application/controller/api/user/profile.php index 922345a..2cbccc1 100644 --- a/src/application/controller/api/user/profile.php +++ b/src/application/controller/api/user/profile.php @@ -8,7 +8,7 @@ $response = [ if (isset($_SESSION['userName'])) { - $userName = isset($_POST['userName']) ? Filter::userName($_POST['userName']) : $_SESSION['userName']; + $userName = isset($_GET['userName']) ? Filter::userName($_GET['userName']) : $_SESSION['userName']; if ($userProfileVersions = $_twister->getDHT($userName, 'profile', 's')) { diff --git a/src/public/js/module/feed.js b/src/public/js/module/feed.js index 18a3e00..805dce7 100644 --- a/src/public/js/module/feed.js +++ b/src/public/js/module/feed.js @@ -74,7 +74,7 @@ var ModuleFeed = { loadAvatar: function(feed, userName) { $.ajax({ url: 'api/user/avatar', - type: 'POST', + type: 'GET', data: { userName: userName }, diff --git a/src/public/js/module/following.js b/src/public/js/module/following.js index 95e9558..a74624a 100644 --- a/src/public/js/module/following.js +++ b/src/public/js/module/following.js @@ -71,7 +71,7 @@ var ModuleFollowing = { loadProfile: function(list, userName) { $.ajax({ url: 'api/user/profile', - type: 'POST', + type: 'GET', data: { userName: userName }, @@ -101,7 +101,7 @@ var ModuleFollowing = { loadAvatar: function(list, userName) { $.ajax({ url: 'api/user/avatar', - type: 'POST', + type: 'GET', data: { userName: userName }, diff --git a/src/public/js/module/post.js b/src/public/js/module/post.js index e51c359..b30bc02 100644 --- a/src/public/js/module/post.js +++ b/src/public/js/module/post.js @@ -5,7 +5,7 @@ var ModulePost = { loadAvatar: function(element) { $.ajax({ url: 'api/user/avatar', - type: 'POST', + type: 'GET', success: function (response) { if (response.success) {