Fix regex
This commit is contained in:
parent
e8145756a7
commit
0c67f02754
3 changed files with 7 additions and 7 deletions
|
|
@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
|
|||
$timeout(function() {
|
||||
var form = addressbookForm;
|
||||
if (data && form) {
|
||||
data = data.replace(/^bitcoin[cash]*:/, '');
|
||||
data = data.replace(/^bitcoin(cash)?:/, '');
|
||||
form.address.$setViewValue(data);
|
||||
form.address.$isValid = true;
|
||||
form.address.$render();
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
}, 100);
|
||||
}
|
||||
// data extensions for Payment Protocol with non-backwards-compatible request
|
||||
if ((/^bitcoin[cash]*:\?r=[\w+]/).exec(data)) {
|
||||
data = decodeURIComponent(data.replace(/bitcoin[cash]*:?r=/, ''));
|
||||
if ((/^bitcoin(cash)?:\?r=[\w+]/).exec(data)) {
|
||||
data = decodeURIComponent(data.replace(/bitcoin(cash)?:\?r=/, ''));
|
||||
$state.go('tabs.send', {}, {
|
||||
'reload': true,
|
||||
'notify': $state.current.name == 'tabs.send' ? false : true
|
||||
|
|
@ -85,9 +85,9 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
|
|||
data = sanitizeUri(data);
|
||||
|
||||
// Bitcoin or Bitcoin Cash URL
|
||||
if ((/^bitcoin[cash]*:/).exec(data)) {
|
||||
if ((/^bitcoin(cash)?:/).exec(data)) {
|
||||
var coin = 'btc';
|
||||
if ((/^bitcoincash*:/).exec(data)) {
|
||||
if ((/^bitcoincash:/).exec(data)) {
|
||||
coin = 'bch';
|
||||
data = data.replace(/bitcoincash*:/, 'bitcoin:');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop
|
|||
|
||||
// This event is sent to an existent instance of Copay (only for standalone apps)
|
||||
gui.App.on('open', function(pathData) {
|
||||
if (pathData.indexOf(/^bitcoin[cash]*:/) != -1) {
|
||||
if (pathData.indexOf(/^bitcoin(cash)?:/) != -1) {
|
||||
$log.debug('Bitcoin URL found');
|
||||
handleOpenURL({
|
||||
url: pathData.substring(pathData.indexOf(/^bitcoin[cash]*:/))
|
||||
url: pathData.substring(pathData.indexOf(/^bitcoin(cash)?:/))
|
||||
});
|
||||
} else if (pathData.indexOf(appConfigService.name + '://') != -1) {
|
||||
$log.debug(appConfigService.name + ' URL found');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue