version 2.x.x - Griffin Chapel ()
+ + Better logging
version 2.8.2 - Dragon Chapel (2023-09-14)
- + Added LOGFILE and QUERY_DEBUG const to config.php. See update.txt for more details
- + Updated DB table charsets. Needs manual DB updates. See update.txt file.
- + Fixed URL handling at creation
- + Improved DB queries.
- + Add top 5 tag or category relation stats in the tag and category overview
- + Updated license to GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
- + Updated error logging and try/catch for mysql
- + Updated from https://github.com/druidfi/mysqldump-php to https://github.com/ifsnop/mysqldump-php since develop
- resumed. Version mysqldump-php v2.11
- + Updated https://github.com/mikehaertl/php-shellcommand to 1.7.0
+ + Added LOGFILE and QUERY_DEBUG const to config.php. See update.txt for more details
+ + Updated DB table charsets. Needs manual DB updates. See update.txt file.
+ + Fixed URL handling at creation
+ + Improved DB queries.
+ + Add top 5 tag or category relation stats in the tag and category overview
+ + Updated license to GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
+ + Updated error logging and try/catch for mysql
+ + Updated from https://github.com/druidfi/mysqldump-php to https://github.com/ifsnop/mysqldump-php since develop
+ resumed. Version mysqldump-php v2.11
+ + Updated https://github.com/mikehaertl/php-shellcommand to 1.7.0
version 2.8.1 - Deathwind Chapel (2022-12-31)
- + Bugfix release
- + Moved debug setting into config
- + Updated shellcommand class and added the link to the github repo
- + Fixed/Updated the creation of the webpage thumbnail using google pagespeed insights api
- + Fixed search index update
- + Fixed missing lang property
- + Fixed xml ex- and import
- + Fixed pagination and sort options in all links view
- + Mysql dump replaced with https://github.com/druidfi/mysqldump-php
- + Updated PHPMailer
- + Removed WKHTMLTOPDF_USE and WKHTMLTOPDF_COMMAND from config. No support for a whole page screenshot yet.
+ + Bugfix release
+ + Moved debug setting into config
+ + Updated shellcommand class and added the link to the github repo
+ + Fixed/Updated the creation of the webpage thumbnail using google pagespeed insights api
+ + Fixed search index update
+ + Fixed missing lang property
+ + Fixed xml ex- and import
+ + Fixed pagination and sort options in all links view
+ + Mysql dump replaced with https://github.com/druidfi/mysqldump-php
+ + Updated PHPMailer
+ + Removed WKHTMLTOPDF_USE and WKHTMLTOPDF_COMMAND from config. No support for a whole page screenshot yet.
version 2.8 - Wastelands (2022-12-10)
- + Fixed documentation
- + Fixed some PHP 8 defaults
- + Fixed #17
+ + Fixed documentation
+ + Fixed some PHP 8 defaults
+ + Fixed #17
version 2.7 - Sacred Grove (2022-06-12)
- + Fixed bug #12. Missing translation key
- + Adapted some new PHP code formatting
- + Fixed some translations
- + Updated bulma css
- + Added random link page
- + New syntax in config file. See update.txt for more details
- + Fixed #13
- + Fixed #15
- + Fixed #14
- + Fixed some small email importer notices and warnings
+ + Fixed bug #12. Missing translation key
+ + Adapted some new PHP code formatting
+ + Fixed some translations
+ + Updated bulma css
+ + Added random link page
+ + New syntax in config file. See update.txt for more details
+ + Fixed #13
+ + Fixed #15
+ + Fixed #14
+ + Fixed some small email importer notices and warnings
version 2.6 - Hypostyle (2021-03-21)
- + Fixed sql problems with Maria DB. Any_value is not supported there
- + Fixed some query and data loading brain fucks..
- + Fixed #10. URL is now considered when building search information.
- Update search index from stats view to update all the exiting information
- + Updated third party information in readme
- + Fixed xml import xsd
- + Added translation support. More information in translation.txt
+ + Fixed sql problems with Maria DB. Any_value is not supported there
+ + Fixed some query and data loading brain fucks..
+ + Fixed #10. URL is now considered when building search information.
+ Update search index from stats view to update all the exiting information
+ + Updated third party information in readme
+ + Fixed xml import xsd
+ + Added translation support. More information in translation.txt
version 2.5.2 - Darkmere (2020-09-12)
- + Fixed bug #8 It is possible to add empty tags and categories.
- Special chars check done on server side. JS has problems with unicode.
- + Fixed bug #7 Edit categories/tags. Rename and move
- + Fixed feature #3 Reduce whitespace in frontend
+ + Fixed bug #8 It is possible to add empty tags and categories.
+ Special chars check done on server side. JS has problems with unicode.
+ + Fixed bug #7 Edit categories/tags. Rename and move
+ + Fixed feature #3 Reduce whitespace in frontend
version 2.5.1 - Caves of Circe (2020-03-22)
- + Bugfix release
+ + Bugfix release
version 2.5 - Winnowing Hall (2020-03-21)
- + Added a thumbnail by talking to Google page speed API
- Planned was a full page snapshot, but only got the thumbnail.
- Needs some more work with headless chrome.
- + Instead you can now decide to make a full page screenshot
- using wkhtmltoimage. See documentation about it.
- + Improved documentation
+ + Added a thumbnail by talking to Google page speed API
+ Planned was a full page snapshot, but only got the thumbnail.
+ Needs some more work with headless chrome.
+ + Instead you can now decide to make a full page screenshot
+ using wkhtmltoimage. See documentation about it.
+ + Improved documentation
version 2.4 - Seven Portals (2020-02-16)
if(DEBUG === true) $EmailReader->mailboxStatus();
}
catch (Exception $e) {
- Summoner::sysLog('[ERROR] Email server connection failed: '.var_export($e->getMessage(),true));
+ Summoner::sysLog('[ERROR] Email server connection failed: '.$e->getMessage());
exit();
}
$emails = $EmailReader->messageWithValidSubject(EMAIL_MARKER);
}
catch (Exception $e) {
- Summoner::sysLog('[ERROR] Can not process email messages: '.var_export($e->getMessage(),true));
+ Summoner::sysLog('[ERROR] Can not process email messages: '.$e->getMessage());
exit();
}
foreach($emails as $emailId=>$emailData) {
$links = EmailImportHelper::extractEmailLinks($emailData['body']);
if(!empty($links)) {
- if(DEBUG === true) var_dump("Links in email:",$links);
+ if(DEBUG === true) Summoner::sysLog("Links in email: ".Summoner::cleanForLog($links));
foreach($links as $linkstring) {
# defaults
$newdata['link'] = Summoner::addSchemeToURL($newdata['link']);
if (!filter_var($newdata['link'], FILTER_VALIDATE_URL)) {
- error_log("ERROR Invalid URL: ".var_export($newdata['link'],true));
- if(DEBUG === true) var_dump("Invalid URL:", $newdata['link']);
+ error_log("ERROR Invalid URL: ".Summoner::cleanForLog($newdata['link']));
+ if(DEBUG === true) Summoner::sysLog("Invalid URL: ".Summoner::cleanForLog($newdata['link']));
continue;
}
}
else {
error_log("WARN No valid title for link found: ".$newdata['link']);
- if(DEBUG === true) var_dump("WARN No valid title for link found: ".var_export($newdata,true));
+ if(DEBUG === true) Summoner::sysLog("[WARN] No valid title for link found: ".Summoner::cleanForLog($newdata));
array_push($invalidProcessedEmails, $emailData);
continue;
}
- if(DEBUG === true) var_dump("New data", $newdata);
+ if(DEBUG === true) Summoner::sysLog("New data ".Summoner::cleanForLog($newdata));
$linkObj = new Link($DB);
$linkID = false;
if(!empty($existing) && isset($existing['id'])) {
$linkID = $existing['id'];
- Summoner::sysLog('[INFO] Updating existing link with tag or category '.$newdata['link']);
+ Summoner::sysLog('[INFO] Updating existing link with tag or category '.Summoner::cleanForLog($newdata['link']));
}
else {
$linkObj = new Link($DB);
'catArr' => $newdata['catArr']
), true);
} catch (Exception $e) {
- $_m = "WARN Can not create new link into DB." . $e->getMessage();
+ $_m = "[WARN] Can not create new link into DB." . $e->getMessage();
Summoner::sysLog($_m);
$emailData['importmessage'] = $_m;
array_push($invalidProcessedEmails, $emailData);
- if (DEBUG === true) var_dump($_m);
- if (DEBUG === true) var_dump($newdata);
+ if (DEBUG === true) Summoner::sysLog($_m);
+ if (DEBUG === true) Summoner::sysLog(Summoner::cleanForLog($newdata));
continue;
}
}
$this->DB->commit();
$ret = true;
} catch (Exception $e) {
- Summoner::sysLog('ERROR Failed to remove category: '.var_export($e->getMessage(),true));
+ Summoner::sysLog('ERROR Failed to remove category: '.$e->getMessage());
$this->DB->rollback();
}
}
$ret = $this->DB->insert_id;
}
else {
- Summoner::sysLog('ERROR Failed to create link: '.var_export($data,true));
+ Summoner::sysLog('ERROR Failed to create link: '.Summoner::cleanForLog($data));
}
} catch (Exception $e) {
Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
$snap = new Snapshot();
$do = $snap->doSnapshot($this->_data['link'], $snapshot);
if(empty($do)) {
- Summoner::sysLog('ERROR Failed to create snapshot: '.var_export($data,true));
+ Summoner::sysLog('ERROR Failed to create snapshot: '.Summoner::cleanForLog($data));
}
}
} elseif ($data['snapshot'] === false) {
$snap = new Snapshot();
$do = $snap->wholePageSnapshot($this->_data['link'], $pagescreenshot);
if(!empty($do)) {
- Summoner::sysLog('ERROR Failed to create snapshot: '.var_export($data,true));
+ Summoner::sysLog('ERROR Failed to create snapshot: '.Summoner::cleanForLog($data));
}
}
} elseif ($data['pagescreenshot'] === false) {
$ret = true;
} else {
$this->DB->rollback();
- Summoner::sysLog('ERROR Failed to update link: '.var_export($data,true));
+ Summoner::sysLog('ERROR Failed to update link: '.Summoner::cleanForLog($data));
}
}
if(!empty($data) && isset($data['link'])) {
if(DEBUG) {
- Summoner::sysLog("DEBUG Using data: ".var_export($data, true));
+ Summoner::sysLog("DEBUG Using data: ".Summoner::cleanForLog($data));
}
require_once 'lib/import-export.class.php';
$ImEx = new ImportExport();
echo $val->attributes . "<br />\n";
}
} else {
- Summoner::sysLog("ERROR imap_getmailboxes failed: ".var_export(imap_last_error()));
+ Summoner::sysLog("ERROR imap_getmailboxes failed: ".Summoner::cleanForLog(imap_last_error()));
}
}
}
Summoner::sysLog("[DEBUG] try to save to $filename with $this->_googlePageSpeed for $url");
}
$theCall = Summoner::curlCall($this->_googlePageSpeed.urlencode($url).'&screenshot=true');
- if(!empty($theCall)) {
- $jsonData = json_decode($theCall,true);
+ if(!empty($theCall['status'])) {
+ $jsonData = json_decode($theCall['message'],true);
if(DEBUG) {
- Summoner::sysLog("[DEBUG] Call result data: ".var_export($jsonData, true));
+ Summoner::sysLog("[DEBUG] Call result data: ".Summoner::cleanForLog($jsonData));
}
if(!empty($jsonData) && isset($jsonData['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'])) {
$imageData = $jsonData['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'];
fclose($source);
fclose($destination);
} elseif(DEBUG) {
- Summoner::sysLog("[DEBUG] invalid json data. Path ['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'] not found in : ".var_export($jsonData, true));
+ Summoner::sysLog("[DEBUG] invalid json data. Path ['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'] not found in : ".Summoner::cleanForLog($jsonData));
}
} elseif(DEBUG) {
- Summoner::sysLog("[DEBUG] curl call failed");
+ Summoner::sysLog("[DEBUG] curl call failed ".Summoner::cleanForLog($theCall));
}
}
*
* @param string $url The request url
* @param int $port
- * @return string
+ * @return array
*/
- static function curlCall(string $url, int $port=0): string {
- $ret = '';
+ static function curlCall(string $url, int $port=0): array {
+ $ret = array('status' => false, 'message' => 'Unknown');
$ch = curl_init();
$do = curl_exec($ch);
if(is_string($do) === true) {
- $ret = $do;
+ $ret['status'] = true;
+ $ret['message'] = $do;
}
else {
- self::sysLog('ERROR '.var_export(curl_error($ch),true));
+ $ret['message'] = curl_error($ch);
}
curl_close($ch);
if(self::validate($url,'url')) {
$data = self::curlCall($url);
- if(!empty($data)) {
- $ret = self::socialMetaInfos($data);
+ if(!empty($data['status'])) {
+ $ret = self::socialMetaInfos($data['message']);
}
}
/**
* Make the input more safe for logging
*
- * @param string $input The string to be made more safe
+ * @param mixed $input The string to be made more safe
* @return string
*/
- static function cleanForLog(string $input): string {
+ static function cleanForLog(mixed $input): string {
$input = var_export($input, true);
$input = preg_replace( "/[\t\n\r]/", " ", $input);
return addcslashes($input, "\000..\037\177..\377\\");
$this->DB->query($queryStr);
$this->DB->commit();
} catch (Exception $e) {
- Summoner::sysLog('[ERROR] Failed to remove tag: '.var_export($e->getMessage(),true));
+ Summoner::sysLog('[ERROR] Failed to remove tag: '.$e->getMessage());
$this->DB->rollback();
}