Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: realvanyek on June 26, 2023, 02:37:55 PM

Title: 2: Undefined array key 7 appears in error log when just browsing forum
Post by: realvanyek on June 26, 2023, 02:37:55 PM
here are some details:

forum.therealvanyek.ml/index.php?action=admin;area=logs;sa=errorlog;desc
/path/to/smf/Sources/Subs.php (Line 4570)
Type of error: Undefined
Error message:[Select]
2: Undefined array key 7

not sure if i need to post in that category
Title: Re: 2: Undefined array key 7 appears in error log when just browsing forum
Post by: Kindred on June 27, 2023, 10:46:26 AM
please include the code from lines 4560-4580 in your subs.php
Title: Re: 2: Undefined array key 7 appears in error log when just browsing forum
Post by: Steve on June 27, 2023, 02:35:48 PM
And please use the code tags.
Title: Re: 2: Undefined array key 7 appears in error log when just browsing forum
Post by: realvanyek on July 04, 2023, 06:15:17 PM
Quote from: Kindred on June 27, 2023, 10:46:26 AMplease include the code from lines 4560-4580 in your subs.php
sorry for late reply, but here it is:
call_integration_hook('integrate_security_files', array(&$securityFiles));

foreach ($securityFiles as $i => $securityFile)
{
if (!file_exists($boarddir . '/' . $securityFile))
unset($securityFiles[$i]);
}

// We are already checking so many files...just few more doesn't make any difference! :P
if (!empty($modSettings['currentAttachmentUploadDir']))
$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];

else
$path = $modSettings['attachmentUploadDir'];

secureDirectory($path, true);
secureDirectory($cachedir);

// If agreement is enabled, at least the english version shall exist
if (!empty($modSettings['requireAgreement']))
$agreement = !file_exists($boarddir . '/agreement.txt');
Title: Re: 2: Undefined array key 7 appears in error log when just browsing forum
Post by: realvanyek on July 04, 2023, 06:16:23 PM
btw the problem was in the attachments dir path, but now it's solved