PluginProbe
Shariff Wrapper / trunk
Shariff Wrapper vtrunk
4.6.22 4.6.21 4.6.20 4.6.19 trunk 1.0.0 1.9.0 1.9.9 2.4.3 3.4.2 4.0.8 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.3.0 4.4.2 4.4.3 4.4.4 4.5.0 4.5.1 4.5.2 4.5.3 4.6.0 All 42 releases
shariff / bitcoin.php

bitcoin.php in Shariff Wrapper trunk, at bitcoin.php

29 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /** @noinspection PhpCSValidationInspection */
2 /**
3 * Generates an QR code for bitcoin.
4 *
5 * @package Shariff Wrapper
6 */
7
8 // prevent external use (as is requested by the automated Plugin Check)
9 if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' ); }
10 if ( ! defined( 'ABSPATH' ) ) exit;
11
12 // Includes php class for QR code generation.
13 require './includes/phpqrcode.php';
14
15 // Gets the bitcoin address.
16 $bitcoinaddress = htmlspecialchars( $_GET['bitcoinaddress'] );
17 // real plausi check on valid address and nothing else
18 if ( ! preg_match( '/^([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[ac-hj-np-z02-9]{11,87})$/', $bitcoinaddress ) ) { http_response_code(400); die(); }
19
20 // Creates the page.
21 echo '<html lang="en"><head><title>Bitcoin</title></head><body>';
22 echo '<div style="text-align:center;"><h1>Bitcoin</h1></div>';
23 echo '<p style="text-align:center;"><a href="bitcoin:' . $bitcoinaddress . '">bitcoin:' . $bitcoinaddress . '</a></p>';
24 echo '<p style="text-align:center;">';
25 QRcode::svg( $bitcoinaddress, false, 'h', 5 );
26 echo '</p>';
27 echo '<p style="text-align:center;">Information: <a href="https://www.bitcoin.org" target="_blank">bitcoin.org</a></p>';
28 echo '</body></html>';
29