]> wagnertech.de Git - timetracker.git/commitdiff
Added a check for config.php file to start with PHP opening tag.
authorNik Okuntseff <support@anuko.com>
Wed, 31 Aug 2016 18:09:41 +0000 (18:09 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 31 Aug 2016 18:09:41 +0000 (18:09 +0000)
WEB-INF/templates/footer.tpl
dbinstall.php

index a91075bb5869ea5442d593074895e3196b878da1..793494dfcc7eb753e1c0aee1208998e50401493e 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.9.30.3528 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.30.3529 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 49d61f1e12a9c0be94c7e6a3b9c0770b3504d6aa..46fc0fc7484a94c79e28ef873f59ecc6400537cb 100755 (executable)
@@ -55,6 +55,16 @@ if ($request->isGet()) {
   // Require the configuration file with application settings.
   if (file_exists(APP_DIR."/WEB-INF/config.php")) {
     echo('WEB-INF/config.php file exists.<br>');
+
+    // Config file must start with the PHP opening tag. We are checking this because
+    // a Unicode editor may insert a byte order matk (BOM) before it. This is not good as it will
+    // spit white space before output in some situations such as in PDF reports.
+    $file = fopen(APP_DIR."/WEB-INF/config.php", "r");
+    $line = fgets($file);
+    if (strcmp("<?php\n", $line) !== 0) {
+      echo('<font color="red">Error: WEB-INF/config.php file does not start with PHP opening tag.</font><br>');
+    }
+    fclose($file);
   } else {
     echo('<font color="red">Error: WEB-INF/config.php file does not exist.</font><br>');
   }