Skip to content

Commit fee7c1b

Browse files
committed
Fix output error for website in user profile
1 parent c479994 commit fee7c1b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/controllers/User/Update.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function &run(Router &$router, View &$view, array &$args) {
6262
$model->skype_username = $model->profile->getSkypeUsername();
6363
$model->steam_id = $model->profile->getSteamId();
6464
$model->twitter_username = $model->profile->getTwitterUsername();
65-
$model->website = $model->profile->getWebsite();
65+
$model->website = $model->profile->getWebsite(false);
6666

6767
}
6868

@@ -358,7 +358,7 @@ public function &run(Router &$router, View &$view, array &$args) {
358358

359359
if ($model->twitter_username !== $model->profile->getTwitterUsername()) {
360360

361-
// steam id change request
361+
// twitter username change request
362362

363363
if (strlen($model->twitter_username) >
364364
$model->twitter_username_max_len
@@ -372,9 +372,9 @@ public function &run(Router &$router, View &$view, array &$args) {
372372

373373
}
374374

375-
if ($model->website !== $model->profile->getWebsite()) {
375+
if ($model->website !== $model->profile->getWebsite(false)) {
376376

377-
// steam id change request
377+
// website change request
378378

379379
if (strlen($model->website) > $model->website_max_len) {
380380
$model->website_error = ['red', 'TOO_LONG'];

src/libraries/UserProfile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ public function getTwitterUsername() {
130130
return $this->twitter_username;
131131
}
132132

133-
public function getWebsite() {
134-
if (!is_string($this->website)) return $this->website;
133+
public function getWebsite($clean = true) {
134+
if (!is_string($this->website) || !$clean) return $this->website;
135135
$value = strtolower($this->website);
136136
if (substr($value, 0, 7) == "http://") {
137137
return substr($value, 7);

0 commit comments

Comments
 (0)