Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Print: use webserver IP config on QR Code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
andi34 authored Dec 17, 2019
1 parent 5d4c3da commit 1b91879
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/print.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
$line2text = $config['textonprint']['line2'];
$line3text = $config['textonprint']['line3'];

// QR
if (!isset($config['webserver_ip'])) {
$SERVER_IP = $_SERVER['HTTP_HOST'];
} else {
$SERVER_IP = $config['webserver_ip'];
}

// print frame
$print_frame = $config['print_frame_path'];

Expand All @@ -44,7 +51,7 @@
// create qr code
if (!file_exists($filename_codes)) {
include('../vendor/phpqrcode/qrlib.php');
$url = 'http://'.$_SERVER['HTTP_HOST'].'/api/download.php?image=';
$url = 'http://'.$SERVER_IP.'/api/download.php?image=';
QRcode::png($url.$filename, $filename_codes, QR_ECLEVEL_H, 10);
}

Expand Down

0 comments on commit 1b91879

Please sign in to comment.