Quantcast
Channel: WordPress.org Forums » [Wordfence Security - Firewall, Malware Scan, and Login Security] Support
Viewing all articles
Browse latest Browse all 33978

jrf on "[Plugin: Wordfence Security] [Bug - fixes included] Plugin causes Undefined index notices in error log"

$
0
0

L.S.,

Thanks for this excellent plugin! Very happy to have found it.

When going through my error logs however I noticed numerous undefined index notices caused by this plugin. I've fixed the ones I found and I hope you will accept the below fixes as a compliment to your work.

Line numbers are based on the latest plugin version, v3.7.2.

File: lib/menu_rangeBlocking.php

Find line 18:

<tr><th>Block anyone that has an IP address in this range:</th><td><input id="ipRange" type="text" size="30" maxlength="255" value="<?php if($_GET['wfBlockRange']){ echo $_GET['wfBlockRange']; } ?>" onkeyup="WFAD.calcRangeTotal();">&nbsp;<span id="wfShowRangeTotal"></span></td></tr>

Replace with:

<tr><th>Block anyone that has an IP address in this range:</th><td><input id="ipRange" type="text" size="30" maxlength="255" value="<?php if( isset( $_GET['wfBlockRange'] ) && $_GET['wfBlockRange']){ echo $_GET['wfBlockRange']; } ?>" onkeyup="WFAD.calcRangeTotal();">&nbsp;<span id="wfShowRangeTotal"></span></td></tr>

File: lib/menu_whois.php

Find line 27:

<?php if($_GET['wfnetworkblock']){ ?>

Replace with:

<?php if( isset( $_GET['wfnetworkblock'] ) && $_GET['wfnetworkblock']){ ?>

Find line 53:

var whoisval = "<?php echo $_GET['whoisval']; ?>";

Replace with:

var whoisval = "<?php if( isset( $_GET['whoisval'] ) ) { echo $_GET['whoisval']; } ?>";

File: lib/schedWeekEntry.php

Find line 23:

$checked = ($sched[$dayIndex][$hour] ? 'checked' : '');

Replace with:

$checked = ( isset( $sched[$dayIndex] ) && $sched[$dayIndex][$hour] ? 'checked' : '');

File: lib/wfLog.php

Find line 400:

if($res['referer']){

Replace with:

if( isset( $res['referer'] ) && $res['referer']){

Find line 417-420:

parse_str($refURL['query'], $queryVars);
							if(isset($queryVars[$q])){
								$res['searchTerms'] = $queryVars[$q];
							}

Replace with:

if( isset( $refURL['query'] ) ) {
								parse_str($refURL['query'], $queryVars);
								if(isset($queryVars[$q])){
									$res['searchTerms'] = $queryVars[$q];
								}
							}

Find line 425:

if ( stristr( $referringPage['host'], 'google.' ) )

Replace with:

if ( isset( $referringPage ) && stristr( $referringPage['host'], 'google.' ) )

File: lib/wordfenceClass.php

Find line 894:

if($err){

Replace with:

if(isset( $err ) && $err){

Find line 1356:

if($result['errorMsg']){

Replace with:

if( isset( $result['errorMsg'] ) && $result['errorMsg']){

Hope this helps!

Smile,
Juliette

http://wordpress.org/extend/plugins/wordfence/


Viewing all articles
Browse latest Browse all 33978

Trending Articles