Alex Zee (OP)
|
|
June 11, 2011, 08:09:47 AM Last edit: June 18, 2011, 07:58:54 AM by AlexZ |
|
.
|
|
|
|
|
|
|
|
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
Vladimir
|
|
June 11, 2011, 08:15:55 AM |
|
I asked mods to have a look into it. Fingers crossed.
|
-
|
|
|
error
|
|
June 11, 2011, 08:17:29 AM |
|
Looks like you have a single / after bitcoin: . That isn't going to work.
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
error
|
|
June 11, 2011, 02:43:30 PM |
|
Yes, but the URI scheme has NO slashes.
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
error
|
|
June 11, 2011, 03:02:14 PM |
|
The bitcoin: URI scheme is not supposed to have any slashes at all, since nothing in Bitcoin is an Internet address or hostname.
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
hamdi
|
|
June 11, 2011, 03:19:25 PM |
|
after RFC the old EDONKEY:// schema was also wrong but worked nice. the uri proposal in the WIKI https://en.bitcoin.it/wiki/URI_Scheme is shit. the one proposed in the forum is nicer to read
|
|
|
|
error
|
|
June 11, 2011, 03:34:42 PM |
|
Sorry, I won't implement a non-RFC compliant URI scheme.
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
error
|
|
June 11, 2011, 03:47:50 PM Last edit: June 11, 2011, 04:00:49 PM by error |
|
Really? You're sourcing Wikipedia instead of a relevant RFC?
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
error
|
|
June 11, 2011, 04:00:39 PM |
|
WTF??? I though at least people in charge here are not that stupid...
Have you even READ any of the RFCs in question? Do you even know what an RFC is?
|
3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
|
|
|
hamdi
|
|
June 11, 2011, 04:04:39 PM |
|
according to RFC after a :// a HOSTNAME must follow.. an amount or a btc-address is no hostname so it is wrong in terms of RFC´s uri schema concept
read up on MAGNET:// and ED2K:// for example...
|
|
|
|
generalunited
Newbie
Offline
Activity: 14
Merit: 0
|
|
June 11, 2011, 04:15:34 PM |
|
link them all over to blockexplorer.com --- anything to make that plain text clickable without having to install a browser extension is going to help in bringing wider adoption to bitcoins... just my two cents..
|
|
|
|
Luke-Jr
Legendary
Offline
Activity: 2576
Merit: 1186
|
|
June 11, 2011, 04:57:07 PM |
|
Here's a patch to add compliant support for bitcoin: URIs. It probably should cleanup/strip any extra //, but I'll leave that to someone else to figure out. It also tries to detect standalone bitcoin addresses and turn them into links. I haven't tested it at all, so use at your own risk. Donations for this patch to 1HXo9py5hFsa528ZuXnSPHcXMyKiB7GN5U diff -ur smf_1-1-13_install/Sources/Subs-Post.php smf_1-1-13_install.bitcoin/Sources/Subs-Post.php --- smf_1-1-13_install/Sources/Subs-Post.php 2011-02-07 11:45:09.000000000 -0500 +++ smf_1-1-13_install.bitcoin/Sources/Subs-Post.php 2011-06-11 12:29:56.169981884 -0400 @@ -330,28 +330,28 @@ // [url]http://...[/url] array( 'tag' => 'url', - 'protocols' => array('http', 'https'), + 'protocols' => array('http', 'https', 'bitcoin:'), 'embeddedUrl' => true, 'hasEqualSign' => false, ), // [url=http://...]name[/url] array( 'tag' => 'url', - 'protocols' => array('http', 'https'), + 'protocols' => array('http', 'https', 'bitcoin:'), 'embeddedUrl' => true, 'hasEqualSign' => true, ), // [iurl]http://...[/iurl] array( 'tag' => 'iurl', - 'protocols' => array('http', 'https'), + 'protocols' => array('http', 'https', 'bitcoin:'), 'embeddedUrl' => true, 'hasEqualSign' => false, ), // [iurl=http://...]name[/iurl] array( 'tag' => 'iurl', - 'protocols' => array('http', 'https'), + 'protocols' => array('http', 'https', 'bitcoin:'), 'embeddedUrl' => true, 'hasEqualSign' => true, ), @@ -475,7 +475,10 @@ $found = false; foreach ($protocols as $protocol) { + if (strpos($protocol, ':') === false) $found = strncasecmp($replace, $protocol . '://', strlen($protocol) + 3) === 0; + else + $found = strncasecmp($replace, $protocol, strlen($protocol)) === 0; if ($found) break; } diff -ur smf_1-1-13_install/Sources/Subs.php smf_1-1-13_install.bitcoin/Sources/Subs.php --- smf_1-1-13_install/Sources/Subs.php 2011-02-07 11:45:09.000000000 -0500 +++ smf_1-1-13_install.bitcoin/Sources/Subs.php 2011-06-11 12:53:18.829672859 -0400 @@ -1330,7 +1330,7 @@ 'content' => '<a href="$1">$1</a>', 'validate' => create_function('&$tag, &$data, $disabled', ' $data = strtr($data, array(\'<br />\' => \'\')); - if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) + if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0 && strpos($data, \'bitcoin:\') !== 0) $data = \'http://\' . $data; '), ), @@ -1342,7 +1342,7 @@ 'validate' => create_function('&$tag, &$data, $disabled', ' if (substr($data, 0, 1) == \'#\') $data = \'#post_\' . substr($data, 1); - elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) + elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0 && strpos($data, \'bitcoin:\') !== 0) $data = \'http://\' . $data; '), 'disallow_children' => array('email', 'ftp', 'url', 'iurl'), @@ -1599,7 +1599,7 @@ 'content' => '<a href="$1" target="_blank">$1</a>', 'validate' => create_function('&$tag, &$data, $disabled', ' $data = strtr($data, array(\'<br />\' => \'\')); - if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) + if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0 && strpos($data, \'bitcoin:\') !== 0) $data = \'http://\' . $data; '), ), @@ -1609,7 +1609,7 @@ 'before' => '<a href="$1" target="_blank">', 'after' => '</a>', 'validate' => create_function('&$tag, &$data, $disabled', ' - if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0) + if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0 && strpos($data, \'bitcoin:\') !== 0) $data = \'http://\' . $data; '), 'disallow_children' => array('email', 'ftp', 'url', 'iurl'), @@ -1747,7 +1747,7 @@ // Take care of some HTML! if (!empty($modSettings['enablePostHTML']) && strpos($data, '<') !== false) { - $data = preg_replace('~<a\s+href=((?:")?)((?:https?://|ftps?://|mailto:)\S+?)\\1>~i', '[url=$2]', $data); + $data = preg_replace('~<a\s+href=((?:")?)((?:https?://|ftps?://|mailto:|bitcoin:)\S+?)\\1>~i', '[url=$2]', $data); $data = preg_replace('~</a>~i', '[/url]', $data); // <br /> should be empty. @@ -1836,10 +1836,14 @@ // Only do this if the preg survives. if (is_string($result = preg_replace(array( '~(?<=[\s>\.(;\'"]|^)((?:http|https|ftp|ftps)://[\w\-_%@:|]+(?:\.[\w\-_%]+)*(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i', - '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i' + '~(?<=[\s>(\'<]|^)(www(?:\.[\w\-_]+)+(?::\d+)?(?:/[\w\-_\~%\.@,\?&;=#(){}+:\'\\\\]*)*[/\w\-_\~%@\?;=#}\\\\])~i', + '~bitcoin:(\w+(?:\?\S+)?)~i', + '~\b([1-9A-HJ-NP-Za-km-z]{26,35})\b' ), array( '[url]$1[/url]', - '[url=http://$1]$1[/url]' + '[url=http://$1]$1[/url]', + '[url]$1[/url]', + '[url=bitcoin:$1]$1[/url]', ), $data))) $data = $result;
|
|
|
|
ThomasV
Legendary
Offline
Activity: 1896
Merit: 1353
|
|
January 17, 2012, 02:00:08 PM |
|
any progress on this?
|
Electrum: the convenience of a web wallet, without the risks
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5194
Merit: 12972
|
|
January 19, 2012, 05:57:23 AM |
|
That section of the code starts with "WARNING: Editing the below can cause large security holes in your forum," so a lot of testing would be necessary to make sure that these changes are safe. (I don't have a test forum set up, so I can't really test it.) It also tries to detect standalone bitcoin addresses and turn them into links.
I don't like this behavior, especially since a single URI specification hasn't been decided on yet (AFAIK).
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
ThomasV
Legendary
Offline
Activity: 1896
Merit: 1353
|
|
January 19, 2012, 06:12:26 AM |
|
That section of the code starts with "WARNING: Editing the below can cause large security holes in your forum," so a lot of testing would be necessary to make sure that these changes are safe. (I don't have a test forum set up, so I can't really test it.)
that's a pity; is no admin able to test patches for this forum? It also tries to detect standalone bitcoin addresses and turn them into links.
I don't like this behavior, especially since a single URI specification hasn't been decided on yet (AFAIK). I agree that detection of standalone addresses is not a good idea; it should be removed. However, the lack of URI specification should not be a problem for a forum patch; all the patch has to do is to give users the ability to write bitcoin: links.
|
Electrum: the convenience of a web wallet, without the risks
|
|
|
Luke-Jr
Legendary
Offline
Activity: 2576
Merit: 1186
|
|
January 19, 2012, 07:09:29 AM |
|
I don't like this behavior, especially since a single URI specification hasn't been decided on yet (AFAIK). Pretty sure the simple bitcoin:<address> case is unanimous.
|
|
|
|
|
piuk
|
|
January 19, 2012, 02:10:11 PM |
|
huh? are you saying that web-based protocols require a web+ prefix?
Yeah in order to register a custom scheme with your browser it must start with web+
|
|
|
|
ThomasV
Legendary
Offline
Activity: 1896
Merit: 1353
|
|
January 19, 2012, 02:19:51 PM |
|
huh? are you saying that web-based protocols require a web+ prefix?
Yeah in order to register a custom scheme with your browser it must start with web+ yes, I just read that too. this restriction seems to apply to Chrome only. https://developer.mozilla.org/en/DOM/navigator.registerProtocolHandler
|
Electrum: the convenience of a web wallet, without the risks
|
|
|
Luke-Jr
Legendary
Offline
Activity: 2576
Merit: 1186
|
|
January 19, 2012, 02:54:03 PM |
|
In order to be compatible with the w3 spec for custom url schemes it would be good if the chosen URI was prefixed with web+ e.g. web+bitcoin:// This will be an epic failure for w3c if it goes through like this. Be sure to write them and tell them how ridiculous these custom URI rules are. More important to comply with the long-standing IETF RFCs, which we already do. Then you can have only a website register itself: normal/sane software is not allowed to register for these "web+" URIs.
|
|
|
|
|