We are getting an error that says there is an error converting an array to string.
https://www.theswamp.org/index.php?topic=44258.0;prev_next=prev8:
Array to string conversion
File: Subs.php
Line: 2322
line 2322: $code = strtr($tag['content'], array('$1' => $data[0], '$2' => $data[1]));
Heres the IF block (starting on line 2265, line 36 in this snip is where the error occurs):
// Don't parse the content, just skip it.
elseif ($tag['type'] == 'unparsed_equals_content')
{
// The value may be quoted for some tags - check.
if (isset($tag['quoted']))
{
$quoted = substr($message, $pos1, 6) == '"';
if ($tag['quoted'] != 'optional' && !$quoted)
continue;
if ($quoted)
$pos1 += 6;
}
else
$quoted = false;
$pos2 = strpos($message, $quoted == false ? ']' : '"]', $pos1);
if ($pos2 === false)
continue;
$pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
if ($pos3 === false)
continue;
$data = array(
substr($message, $pos2 + ($quoted == false ? 1 : 7), $pos3 - ($pos2 + ($quoted == false ? 1 : 7))),
substr($message, $pos1, $pos2 - $pos1)
);
if (!empty($tag['block_level']) && substr($data[0], 0, 6) == '<br />')
$data[0] = substr($data[0], 6);
// Validation for my parking, please!
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
$code = strtr($tag['content'], array('$1' => $data[0], '$2' => $data[1]));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
$pos += strlen($code) - 1 + 2;
}
// A closed tag, with no content or value.
elseif ($tag['type'] == 'closed')
{
$pos2 = strpos($message, ']', $pos);
$message = substr($message, 0, $pos) . "\n" . $tag['content'] . "\n" . substr($message, $pos2 + 1);
$pos += strlen($tag['content']) - 1 + 2;
}
// This one is sorta ugly... :/. Unfortunately, it's needed for flash.
elseif ($tag['type'] == 'unparsed_commas_content')
{
$pos2 = strpos($message, ']', $pos1);
if ($pos2 === false)
continue;
$pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
if ($pos3 === false)
continue;
// We want $1 to be the content, and the rest to be csv.
$data = explode(',', ',' . substr($message, $pos1, $pos2 - $pos1));
$data[0] = substr($message, $pos2 + 1, $pos3 - $pos2 - 1);
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
$code = $tag['content'];
foreach ($data as $k => $d)
$code = strtr($code, array('$' . ($k + 1) => trim($d)));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
$pos += strlen($code) - 1 + 2;
}
// This has parsed content, and a csv value which is unparsed.
elseif ($tag['type'] == 'unparsed_commas')
{
$pos2 = strpos($message, ']', $pos1);
if ($pos2 === false)
continue;
$data = explode(',', substr($message, $pos1, $pos2 - $pos1));
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
// Fix after, for disabled code mainly.
foreach ($data as $k => $d)
$tag['after'] = strtr($tag['after'], array('$' . ($k + 1) => trim($d)));
$open_tags[] = $tag;
// Replace them out, $1, $2, $3, $4, etc.
$code = $tag['before'];
foreach ($data as $k => $d)
$code = strtr($code, array('$' . ($k + 1) => trim($d)));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + 1);
$pos += strlen($code) - 1 + 2;
}
// A tag set to a value, parsed or not.
elseif ($tag['type'] == 'unparsed_equals' || $tag['type'] == 'parsed_equals')
{
// The value may be quoted for some tags - check.
if (isset($tag['quoted']))
{
$quoted = substr($message, $pos1, 6) == '"';
if ($tag['quoted'] != 'optional' && !$quoted)
continue;
if ($quoted)
$pos1 += 6;
}
else
$quoted = false;
$pos2 = strpos($message, $quoted == false ? ']' : '"]', $pos1);
if ($pos2 === false)
continue;
$data = substr($message, $pos1, $pos2 - $pos1);
// Validation for my parking, please!
if (isset($tag['validate']))
$tag['validate']($tag, $data, $disabled);
// For parsed content, we must recurse to avoid security problems.
if ($tag['type'] != 'unparsed_equals')
$data = parse_bbc($data, !empty($tag['parsed_tags_allowed']) ? false : true, '', !empty($tag['parsed_tags_allowed']) ? $tag['parsed_tags_allowed'] : array());
$tag['after'] = strtr($tag['after'], array('$1' => $data));
$open_tags[] = $tag;
$code = strtr($tag['before'], array('$1' => $data));
$message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + ($quoted == false ? 1 : 7));
$pos += strlen($code) - 1 + 2;
}
EDIT:
I needed to keep this link for myself.
http://www.roseindia.net/tutorial/php/phpbasics/PHP-Array-to-String.html