Fix $x was not initialized on first iteration of for loop (#6936)
This commit is contained in:
parent
d4b3d8682b
commit
e47b2e3710
|
|
@ -48,13 +48,12 @@ class sounds {
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$recordings = $database->select($sql, $parameters, 'all');
|
$recordings = $database->select($sql, $parameters, 'all');
|
||||||
if (is_array($recordings) && @sizeof($recordings) != 0) {
|
if (is_array($recordings) && @sizeof($recordings) != 0) {
|
||||||
foreach ($recordings as &$row) {
|
foreach ($recordings as $x => &$row) {
|
||||||
$recording_name = $row["recording_name"];
|
$recording_name = $row["recording_name"];
|
||||||
$recording_filename = $row["recording_filename"];
|
$recording_filename = $row["recording_filename"];
|
||||||
$recording_path = !empty($this->full_path) && is_array($this->full_path) && in_array('recordings', $this->full_path) ? $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/' : null;
|
$recording_path = !empty($this->full_path) && is_array($this->full_path) && in_array('recordings', $this->full_path) ? $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/' : null;
|
||||||
$array['recordings'][$x]['name'] = $recording_name;
|
$array['recordings'][$x]['name'] = $recording_name;
|
||||||
$array['recordings'][$x]['value'] = $recording_path.$recording_filename;
|
$array['recordings'][$x]['value'] = $recording_path.$recording_filename;
|
||||||
$x++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($sql, $parameters, $recordings, $row);
|
unset($sql, $parameters, $recordings, $row);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue