-----BEGIN BITCOIN SIGNED MESSAGE-----
a line followed by a linebreak
this is shorena from bitcointalk.org, today is 2015.08.09 and this is a test for chainquery.com
-----BEGIN SIGNATURE-----
18uTXyQubfaYrkbQDdaXhzd2ALEY5YN77B
IG5WyElz95PZmiW47KV12iQd5Xnu4SkrkxJTkdaaqa0vav4tdDCTg1kVyqJ58inkDMrdoDCLAkKi4cwTAhGZmQ0=
-----END BITCOIN SIGNED MESSAGE-----
Thanks again for the bug report, this was challenging as we want Chain Query to be platform independent when released (we are getting very close)...
That means that not only do we have to support various platforms and browsers submitting the form, but also various platforms that bitcoind may be run on to process it.
Typically this is not a huge deal, but as we are verifying a signed message, the message must match the signature exactly or the result will be false.
There is really no standardization around end of line characters:
\n is a linux/unix line break
\r is a classic mac line break [OS X uses the above unix \n]
\r\n is a windows line break
And that does not take into account how various browsers handle the post data.
Surprisingly in PHP we were able to put together a rather elegant and efficient solution for OS independent end of line characters (after lots of trial and error):
Pseudo code:
$newLineChars = array("\r\n","\r","\n");
$fixedMessage = str_replace($newLineChars, PHP_EOL, $message);
The array of various new line characters looks for any variation of the newline and replaces it with the PHP_EOL constant in the signed $message.
PHP_EOL is a constant holding the line break character(s) used by the platform the app and bitcoind are running on.
This has been tested with your signed message (including the line break) browsing from OSx with Firefox, Chrome and Safari both in my dev environment, OSx, and on the beta server, Ubuntu 14.04, both with Bitcoin core 0.11.0.
It should also work just fine on your windows machine (fingers crossed)...
Again, thanks for the report and for considering Chain Query for your tutorial.
Thanks for the fast solution, messages verify just fine on Win7 and Win8.1. I will add the site over the next days.