Don't try to match photos if the field is empty.
This commit is contained in:
@@ -77,12 +77,14 @@ foreach ($lga_list as $lga) {
|
|||||||
|
|
||||||
foreach ($lga_candidates as $candidate) {
|
foreach ($lga_candidates as $candidate) {
|
||||||
/* Add extension to photo hash */
|
/* Add extension to photo hash */
|
||||||
|
if (strlen($candidate['Photo'])) {
|
||||||
foreach ($dir_files as $file) {
|
foreach ($dir_files as $file) {
|
||||||
if (preg_match("/\.json$/", $file)) continue;
|
if (preg_match("/\.json$/", $file)) continue;
|
||||||
if (strstr($file, $candidate['Photo'])) {
|
if (strstr($file, $candidate['Photo'])) {
|
||||||
$candidate['Photo'] = $file;
|
$candidate['Photo'] = $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
$candidate['match_ward'],
|
$candidate['match_ward'],
|
||||||
|
|||||||
Reference in New Issue
Block a user