Php and JavaScript Bugs Found
-
Hello.
In trouble shooting the compatibility of our two plugins, I found a few bugs that you might like to know about.1. file: simplepagetester.php
function sptDetailsMeta()
around line: 257
you are simply echoingcount($sptData[$sptData['master_id'] . '_visits']);with out first checking to see if it has been set.
Before:echo ' </select> % </td> </tr> <tr> <th scope="row" colspan="1">Total Unique Visits:</th> <td colspan="2">' . count($sptData[$sptData['master_id'] . '_visits']) . '</td> </tr>';After:
echo '</select> % </td></tr> <tr><th scope="row" colspan="1">Total Unique Visits:</th><td colspan="2">'; if( !empty($sptData[$sptData['master_id'] . '_visits']) ){ echo count($sptData[$sptData['master_id'] . '_visits']); } echo '</td></tr>';2. Same file, same issue around line 302:
Before:<td colspan="2">' . count($sptData[$sptData['slave_id'] . '_visits']) .After:
<td colspan="2">'; if( !empty( $sptData[$sptData['slave_id'] . '_visits'] ) ){ echo count($sptData[$sptData['slave_id'] . '_visits']); }3. same file
function: sptRecordVisit()
around line 506
session_start() is throwing an error because the session has already been started. either remove this or check before starting the session.//session_start();4. same file, same function, around line 531:
Before:'ip' => getenv(REMOTE_ADDR)After:
'ip' => getenv('REMOTE_ADDR')5. file: sptHelper.js
function: sptDrawChart
around lines 66 and 71
not checking first to see if the variable has been set.
Before:if (chart_data[0].length == 5)After:
if (chart_data[0].length && chart_data[0].length == 5)
The topic ‘Php and JavaScript Bugs Found’ is closed to new replies.