added openlog functions

This commit is contained in:
Peter Molnar 2013-04-18 16:10:40 +01:00
parent 6b10505d7c
commit 2cb41589c7
3 changed files with 8 additions and 18 deletions

View file

@ -377,14 +377,18 @@ if (!class_exists('WP_Plugins_Abstract')) {
switch ( $log_level ) {
case LOG_ERR :
if ( function_exists( 'syslog' ) )
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) ) {
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG);
syslog( $log_level , self::plugin_constant . $message );
}
/* error level is real problem, needs to be displayed on the admin panel */
throw new Exception ( $message );
break;
default:
if ( function_exists( 'syslog' ) && $this->config['debug'] )
if ( function_exists( 'syslog' ) && function_exists ( 'openlog' ) && $this->config['debug'] ) {
openlog('wordpress('.$_SERVER['HTTP_HOST'].')',LOG_NDELAY|LOG_PID,LOG_SYSLOG);
syslog( $log_level , self::plugin_constant . $message );
}
break;
}

View file

@ -766,8 +766,8 @@ if ( ! class_exists( 'WP_FFPC' ) ) {
}';
/* replace the data prefix with the configured one */
$to_replace = array ( 'DATAPREFIX' , 'SERVERROOT' );
$replace_with = array ( $this->options['prefix_data'], ABSPATH );
$to_replace = array ( 'DATAPREFIX' , 'SERVERROOT', 'SERVERLOG' );
$replace_with = array ( $this->options['prefix_data'], ABSPATH, $_SERVER['SERVER_NAME'] );
$nginx = str_replace ( $to_replace , $replace_with , $nginx );
/* set upstream servers from configured servers, best to get from the actual backend */

View file

@ -47,24 +47,10 @@ MEMCACHED_SERVERS
location ~ [a-zA-Z0-9_]=(\.\.//?)+ { deny all; }
location ~ [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ { deny all; }
## Disable Akeeba Remote Control 2.5 and earlier
if ($http_user_agent ~ "Indy Library") { return 403; }
## Common bandwidth hoggers and hacking tools.
if ($http_user_agent ~ "libwww-perl") { return 403; }
if ($http_user_agent ~ "GetRight") { return 403; }
if ($http_user_agent ~ "GetWeb!") { return 403; }
if ($http_user_agent ~ "Go!Zilla") { return 403; }
if ($http_user_agent ~ "Download Demon") { return 403; }
if ($http_user_agent ~ "Go-Ahead-Got-It") { return 403; }
if ($http_user_agent ~ "TurnitinBot") { return 403; }
if ($http_user_agent ~ "GrabNet") { return 403; }
## wordpress security
location ~* wp-config.php { deny all; }
location ~* wp-admin/includes { deny all; }
location ~* wp-app\.log { deny all; }
location ~* wp-includes/.*\.php$ { deny all; }
location ~ /wp-content/plugins/akismet/readme\.txt { deny all; }
location ~ (licence|readme|license)\.(html|txt) { deny all; }