Support Forums - Classified Ads Script Osclass
Osclass plugin support => Image Required Plugin => Topic started by: aroca on April 29, 2016, 06:25:35 AM
-
Error when no picture added (we tested if user will not add picture)
ERROR:
Warning: Illegal string offset 'name' in /xx/xx/public_html/xx/oc-content/plugins/image_required/index.php on line 78
Warning: Cannot modify header information - headers already sent by (output started at /xx/xx/public_html/xx/oc-includes/osclass/utils.php:1740) in /xx/xx/public_html/xx/oc-includes/osclass/utils.php on line 1745
Line 78
$img_uploading = count($aItem['photos']['name']);
Lines 1738-1748
function osc_redirect_to($url, $code = null) {
if(ob_get_length()>0) {
ob_end_flush();
}
if($code!=null) {
header("Location: ".$url, true, $code);
} else {
header("Location: ".$url);
}
exit;
}
What to do? Thank you!
NOTE: No problem if with picture :))
-
@aroca
Well that is interesting, as PHP control should never be activated on site without errors.
Unfortunately I cannt get such problem, please PM me login to your FTP and your URL so I can investigate what is issue.
Thanks
-
same issue on my site.
Warning: Illegal string offset 'name' in #/oc-content/plugins/image_required/index.php on line 78
Warning: Cannot modify header information - headers already sent by (output started at #/oc-includes/osclass/utils.php:1740) in #/oc-includes/osclass/utils.php on line 1745
please solve this issue.
-
@sachinthana
As I cannot replicate problem, PM me login to your ftp & oc-admin.
-
@aroca, @sachinthana
I think I have identified problem.
To fix, please go to file:
oc-content/plugins/image_required/index.php
Find code (there are 2 occurences):
$img_uploading = count($aItem['photos']['name']);
$img_count = $img_exists + $img_uploading;
Replace with (both of them):
if(array_key_exists('name', $aItem['photos'])) {
$img_uploading = count($aItem['photos']['name']);
$img_count = $img_exists + $img_uploading;
} else {
$img_count = 0;
}