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');