FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » virtual hosts support
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: virtual hosts support [message #28121 is a reply to message #28116] Tue, 11 October 2005 20:45 Go to previous messageGo to previous message
ruzam is currently offline  ruzam   Canada
Messages: 44
Registered: July 2005
Karma:
Member
Here are patches to admerr.php, core.inc and err.inc.t

First, I replace all (both) direct calls to error_log with a function __error_log. Now you have a single point of log formating. __error_log formats the time and message body. Instead of base64 encoding, newlines (and html '<br />') are replaced with the literal '\n', so each log entry goes on one line (in plain text). It's not pretty, but it's entirely readable under any circumstance and at least as fool proof as base64 encoding.

Next I introduce a new function __error_log_explode() which takes a formatted log line text string and returns the $time and $msg. $msg gets the htmlspecialchars() treatment and literal '\n' replaced with html '<br />'. Now you have a common 'decode' function.

The rest of the patch just changes code to use the new functions.

With __error_log() and _error_log_explode() FUD no longer needs to know or care what format the log files are stored as. As far as I can tell, text based logs will appear exactly the same. If you want to be really tricky, you could even mod __error_log_explode() to check for an old format base64 encoded log entry and handle it differently to be compatible with existing FUD log files. Since these are only used for logging errors and displaying them on the admin page, there really isn't any concern for processing overhead.

Encoding log files is never a good idea...

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: dont show catagories if they are invisible
Next Topic: default forum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 21:50:06 GMT 2024

Total time taken to generate the page: 0.04012 seconds