mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
Change regex to match more closely the api
This commit is contained in:
parent
6ac8ede582
commit
36a01c7f70
4 changed files with 15 additions and 4 deletions
|
@ -55,8 +55,16 @@ class AcquisitionActions extends Actions
|
|||
|
||||
if ($desired_lbry_channel_name_is_valid) {
|
||||
$token = LBRY::connectYoutube($desired_lbry_channel_name);
|
||||
var_dump($token);
|
||||
var_dump($desired_lbry_channel_name);
|
||||
if ($token['success'] == false) {
|
||||
Controller::redirect('/youtube?error=true&error_message=' . $token['error']);
|
||||
}
|
||||
else {
|
||||
Controller::redirect($token['data']);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public static function actionYoutubeEdit($status_token, $channel_name, $email, $sync_consent, $current_value)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ $sync_consent = isset($_POST['sync_consent']);
|
|||
|
||||
$current_value = LBRY::statusYoutube($status_token);
|
||||
|
||||
if(!preg_match("/([@][1-z]+)/", $channel_name)){
|
||||
if(!preg_match("/@[A-Za-z0-9_-]+$/", $channel_name)){
|
||||
$channel_name = "@" . $channel_name;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php
|
||||
$desired_lbry_channel_name = $_POST['desired_lbry_channel_name'];
|
||||
|
||||
if(!preg_match("/([@][1-z]+)/", $desired_lbry_channel_name)){
|
||||
if(!preg_match("/@[A-Za-z0-9_-]+$/", $desired_lbry_channel_name)){
|
||||
$desired_lbry_channel_name = "@" . $desired_lbry_channel_name;
|
||||
}
|
||||
|
||||
AcquisitionActions::actionYoutubeToken($desired_lbry_channel_name);
|
||||
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ function validateEmail(email) {
|
|||
}
|
||||
|
||||
function validateLBRYName(lbry_channel_name){
|
||||
var re = /[1-z]+/;
|
||||
var re = /[@A-Za-z0-9_-]+$/;
|
||||
return re.test(lbry_channel_name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue