From 97d483524ad37e814a2c10167d2e0179b18411f4 Mon Sep 17 00:00:00 2001 From: Erik Thuning <boooink@gmail.com> Date: Tue, 11 Jun 2019 17:19:00 +0200 Subject: [PATCH] Fixed bugs caused by the previous commit --- include/ProductPage.php | 2 +- include/QR.php | 2 +- index.php | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/ProductPage.php b/include/ProductPage.php index ae26645..e9d23fe 100644 --- a/include/ProductPage.php +++ b/include/ProductPage.php @@ -80,7 +80,7 @@ class ProductPage extends Page { 'tags' => $tags, 'info' => $info); $label = ''; - if(class_exists('QRcode', false)) { + if(class_exists('QRcode')) { $label = replace($fields, $this->fragments['product_label']); } $fields['label'] = $label; diff --git a/include/QR.php b/include/QR.php index 9525b65..b5663d3 100644 --- a/include/QR.php +++ b/include/QR.php @@ -10,7 +10,7 @@ class QR extends Responder { } public function render() { - if(class_exists('QRcode', false)) { + if(class_exists('QRcode')) { QRcode::svg((string)$this->product->get_serial()); } } diff --git a/index.php b/index.php index 5ad5a7d..052c6b9 100755 --- a/index.php +++ b/index.php @@ -1,13 +1,14 @@ <?php -set_include_path(get_include_path().PATH_SEPARATOR.'include/'); spl_autoload_register(function ($class) { - if($class == 'qrcode') { + if($class == 'QRcode') { include('./phpqrcode/qrlib.php'); + return; } + include('./include/'.$class.'.php'); }); require('./config.php'); -require('functions.php'); +require('./include/functions.php'); header('Content-Type: text/html; charset=UTF-8');