mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
fix it for real
This commit is contained in:
parent
c84e3606e9
commit
3892c52ec0
2 changed files with 8 additions and 6 deletions
|
@ -88,13 +88,12 @@ class AcquisitionActions extends Actions
|
|||
$current_value = LBRY::statusYoutube($status_token);
|
||||
if ($current_value['data']['email'] == $email) {
|
||||
if ($channel_name === null && $sync_consent === false) {
|
||||
Controller::redirect("/youtube/status/". $status_token);
|
||||
return Controller::redirect("/youtube/status/". $status_token);
|
||||
}
|
||||
$status = LBRY::editYoutube($status_token, $channel_name, null, $sync_consent);
|
||||
} else {
|
||||
$status = LBRY::editYoutube($status_token, $channel_name, $email, $sync_consent);
|
||||
}
|
||||
|
||||
if ($status['success'] == false) {
|
||||
Session::setFlash(Session::KEY_YOUTUBE_SYNC_ERROR, $status['error']);
|
||||
Controller::redirect("/youtube/status/". $status_token);
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
<?php
|
||||
$status_token = Request::encodeStringFromUser($_POST['status_token']);
|
||||
$channel_name = Request::encodeStringFromUser($_POST['new_preferred_channel']);
|
||||
$channel_name = null;
|
||||
if (isset($_POST['new_preferred_channel'])) {
|
||||
$channel_name = Request::encodeStringFromUser($_POST['new_preferred_channel']);
|
||||
}
|
||||
$email = Request::encodeStringFromUser($_POST['new_email']);
|
||||
$sync_consent = isset($_POST['sync_consent']);
|
||||
|
||||
|
||||
if ($channel_name !== "" && !preg_match("/@[A-Za-z0-9-]+$/", $channel_name)) {
|
||||
if ($channel_name !== "" && $channel_name !== null && !preg_match("/@[A-Za-z0-9-]+$/", $channel_name)) {
|
||||
$channel_name = "@" . $channel_name;
|
||||
}
|
||||
|
||||
if ($channel_name === ""){
|
||||
if ($channel_name === "") {
|
||||
$channel_name = null;
|
||||
}
|
||||
AcquisitionActions::actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent);
|
||||
|
|
Loading…
Add table
Reference in a new issue