Author Topic: SMF2.0.4 - Error: Subs.php / Array to String Conversion  (Read 10844 times)

Se7en

  • Newbie
  • *
  • Posts: 3
    • View Profile
SMF2.0.4 - Error: Subs.php / Array to String Conversion
« on: April 05, 2013, 05:42:25 PM »
Hello codebirth,
Thank you for your mod.

Our forum is running SMF v2.0.4, PHP v5.4 and MySQL v5.6

We have installed your mod (1.1) but are receiving errors with Subs.php (Array to String Conversion). Do you happen to have a clue as to what may be causing this? I am at a total loss at this point (any incite you may have would be appreciated).

codebirth

  • Administrator
  • *
  • Posts: 36
    • View Profile
    • c o d e b i r t h
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #1 on: April 07, 2013, 10:04:34 AM »
Hello Se7en,

I have just installed the mod on a fresh SMF 2.0.4 and I got no errors, but I'm using PHP 5.3. I think the error can be related with new changes in PHP 5.4, but unfortunately I can't test it at the moment  :( I'll try to take a look to this in the following days.

Thank you.
c o d e b i r t h

Se7en

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #2 on: April 08, 2013, 04:54:18 PM »
Thank you very much.

To save you some time (maybe you won't have to update) ;) here is the error we are getting (let me know if you need the link).

Code: [Select]
Array to string conversion
File: Subs.php
Line: 2322

line 2322 is: $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:
Code: PHP
  1.                 // Don't parse the content, just skip it.
  2.                 elseif ($tag['type'] == 'unparsed_equals_content')
  3.                 {
  4.                         // The value may be quoted for some tags - check.
  5.                         if (isset($tag['quoted']))
  6.                         {
  7.                                 $quoted = substr($message, $pos1, 6) == '"';
  8.                                 if ($tag['quoted'] != 'optional' && !$quoted)
  9.                                         continue;
  10.  
  11.                                 if ($quoted)
  12.                                         $pos1 += 6;
  13.                         }
  14.                         else
  15.                                 $quoted = false;
  16.  
  17.                         $pos2 = strpos($message, $quoted == false ? ']' : '"]', $pos1);
  18.                         if ($pos2 === false)
  19.                                 continue;
  20.                         $pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
  21.                         if ($pos3 === false)
  22.                                 continue;
  23.  
  24.                         $data = array(
  25.                                 substr($message, $pos2 + ($quoted == false ? 1 : 7), $pos3 - ($pos2 + ($quoted == false ? 1 : 7))),
  26.                                 substr($message, $pos1, $pos2 - $pos1)
  27.                         );
  28.  
  29.                         if (!empty($tag['block_level']) && substr($data[0], 0, 6) == '<br />')
  30.                                 $data[0] = substr($data[0], 6);
  31.  
  32.                         // Validation for my parking, please!
  33.                         if (isset($tag['validate']))
  34.                                 $tag['validate']($tag, $data, $disabled);
  35.  
  36.                         $code = strtr($tag['content'], array('$1' => $data[0], '$2' => $data[1]));
  37.                         $message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
  38.                         $pos += strlen($code) - 1 + 2;
  39.                 }
  40.                 // A closed tag, with no content or value.
  41.                 elseif ($tag['type'] == 'closed')
  42.                 {
  43.                         $pos2 = strpos($message, ']', $pos);
  44.                         $message = substr($message, 0, $pos) . "\n" . $tag['content'] . "\n" . substr($message, $pos2 + 1);
  45.                         $pos += strlen($tag['content']) - 1 + 2;
  46.                 }
  47.                 // This one is sorta ugly... :/.  Unfortunately, it's needed for flash.
  48.                 elseif ($tag['type'] == 'unparsed_commas_content')
  49.                 {
  50.                         $pos2 = strpos($message, ']', $pos1);
  51.                         if ($pos2 === false)
  52.                                 continue;
  53.                         $pos3 = stripos($message, '[/' . substr($message, $pos + 1, strlen($tag['tag'])) . ']', $pos2);
  54.                         if ($pos3 === false)
  55.                                 continue;
  56.  
  57.                         // We want $1 to be the content, and the rest to be csv.
  58.                         $data = explode(',', ',' . substr($message, $pos1, $pos2 - $pos1));
  59.                         $data[0] = substr($message, $pos2 + 1, $pos3 - $pos2 - 1);
  60.  
  61.                         if (isset($tag['validate']))
  62.                                 $tag['validate']($tag, $data, $disabled);
  63.  
  64.                         $code = $tag['content'];
  65.                         foreach ($data as $k => $d)
  66.                                 $code = strtr($code, array('$' . ($k + 1) => trim($d)));
  67.                         $message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos3 + 3 + strlen($tag['tag']));
  68.                         $pos += strlen($code) - 1 + 2;
  69.                 }
  70.                 // This has parsed content, and a csv value which is unparsed.
  71.                 elseif ($tag['type'] == 'unparsed_commas')
  72.                 {
  73.                         $pos2 = strpos($message, ']', $pos1);
  74.                         if ($pos2 === false)
  75.                                 continue;
  76.  
  77.                         $data = explode(',', substr($message, $pos1, $pos2 - $pos1));
  78.  
  79.                         if (isset($tag['validate']))
  80.                                 $tag['validate']($tag, $data, $disabled);
  81.  
  82.                         // Fix after, for disabled code mainly.
  83.                         foreach ($data as $k => $d)
  84.                                 $tag['after'] = strtr($tag['after'], array('$' . ($k + 1) => trim($d)));
  85.  
  86.                         $open_tags[] = $tag;
  87.  
  88.                         // Replace them out, $1, $2, $3, $4, etc.
  89.                         $code = $tag['before'];
  90.                         foreach ($data as $k => $d)
  91.                                 $code = strtr($code, array('$' . ($k + 1) => trim($d)));
  92.                         $message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + 1);
  93.                         $pos += strlen($code) - 1 + 2;
  94.                 }
  95.                 // A tag set to a value, parsed or not.
  96.                 elseif ($tag['type'] == 'unparsed_equals' || $tag['type'] == 'parsed_equals')
  97.                 {
  98.                         // The value may be quoted for some tags - check.
  99.                         if (isset($tag['quoted']))
  100.                         {
  101.                                 $quoted = substr($message, $pos1, 6) == '&quot;';
  102.                                 if ($tag['quoted'] != 'optional' && !$quoted)
  103.                                         continue;
  104.  
  105.                                 if ($quoted)
  106.                                         $pos1 += 6;
  107.                         }
  108.                         else
  109.                                 $quoted = false;
  110.  
  111.                         $pos2 = strpos($message, $quoted == false ? ']' : '&quot;]', $pos1);
  112.                         if ($pos2 === false)
  113.                                 continue;
  114.  
  115.                         $data = substr($message, $pos1, $pos2 - $pos1);
  116.  
  117.                         // Validation for my parking, please!
  118.                         if (isset($tag['validate']))
  119.                                 $tag['validate']($tag, $data, $disabled);
  120.  
  121.                         // For parsed content, we must recurse to avoid security problems.
  122.                         if ($tag['type'] != 'unparsed_equals')
  123.                                 $data = parse_bbc($data, !empty($tag['parsed_tags_allowed']) ? false : true, '', !empty($tag['parsed_tags_allowed']) ? $tag['parsed_tags_allowed'] : array());
  124.  
  125.                         $tag['after'] = strtr($tag['after'], array('$1' => $data));
  126.  
  127.                         $open_tags[] = $tag;
  128.  
  129.                         $code = strtr($tag['before'], array('$1' => $data));
  130.                         $message = substr($message, 0, $pos) . "\n" . $code . "\n" . substr($message, $pos2 + ($quoted == false ? 1 : 7));
  131.                         $pos += strlen($code) - 1 + 2;
  132.                 }
  133.  

codebirth

  • Administrator
  • *
  • Posts: 36
    • View Profile
    • c o d e b i r t h
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #3 on: April 17, 2013, 08:19:12 AM »
Thanks Se7en, that sure helps :) I'll let you know as soon as I can test a fix for PHP 5.4
c o d e b i r t h

codebirth

  • Administrator
  • *
  • Posts: 36
    • View Profile
    • c o d e b i r t h
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #4 on: April 19, 2013, 07:39:21 AM »
I already have a fix and will update the mod by the weekend.

Thank you.
c o d e b i r t h

Se7en

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #5 on: April 19, 2013, 02:44:13 PM »
Wonderful! A big thank you from all the users of our community.

...patiently waiting.

codebirth

  • Administrator
  • *
  • Posts: 36
    • View Profile
    • c o d e b i r t h
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #6 on: April 20, 2013, 09:33:24 AM »
Hi Se7en, the mod has now been updated on SMF mods site.

Thanks for your patience and support! :)
c o d e b i r t h

jlgg

  • Newbie
  • *
  • Posts: 19
    • View Profile
jlgg
« Reply #7 on: December 09, 2015, 09:17:41 AM »
louis vuitton purses,http://www.louisvuittonpursesonsale.us
burberry purses outlet,http://www.burberrypurse.us.com
coach tote bags,http://www.coachtotebags.us
louis vuitotn speedy,http://www.louisvuittonspeedy35.us.com
gucci messenger bag for women,http://www.guccimessengerbag.us
coach sunglasses for women,http://www.coach-sunglasses.co
chanel classic flap bag price,http://www.chanelclassicflapbag.us
michael kors tote bags,http://www.michaelkorstotebags.us.com
gucci clutch,http://www.gucciclutch.us
michael kors bags,http://www.michaelkorsbagsonsale.biz
Chanel Clutch Bags,http://www.chanel-clutch.us
michael kors handbags on sale,http://www.michaelkorshandbagsonsale.us
uggs on sale for women,http://www.uggsonsale.in
ugg bailey button boots,http://www.uggbaileybutton.us
coach wallets,http://www.coach-wallets.co
hermes belt,http://www.hermes-belt.us
free ugg,http://www.freeshoes.us
coach purse outlet online 80% off,http://www.coachpurseoutlet.co
louis vuitton tote,http://www.louisvuittontotebag.us.com
burberry wallets,http://www.burberrywallets.us
chanel tote bag 2015,http://www.chanel-tote-bag.us
mcm duffle bag,http://www.mcm-duffle-bag.us
burberry diaper bag,http://www.burberrydiaperbag.us
MCM Cheap Duffle Bags,http://www.mcm-duffle-bag.us
chanel clutch bag,http://www.chanel-clutch.us
louis vuitton artsy mm,http://www.louisvuittonartsy.us.com
uggs for cheap,http://www.uggsforwomen.net
coach backpack,http://www.coach-backpack.us
chanel clutch,http://www.chanel-clutch.us
burberry bags on sale,http://www.burberrybags.us.com
ugg women boots,http://www.uggwomenboots.us
gucci sunglasses for women,http://www.guccisunglassesforwomen.co
MCM Factory Outlet,http://www.mcm-tote-bag.us
trx for sale,http://www.trxstraps.us
coach hobo bag,http://www.coachhobobag.us
Burberry Wallets Women,http://www.burberrywallets.us
trx band workouts,http://www.trxworkouts.us
prada tote,http://www.prada-tote.us.com
Hermes Birkin Price 2015,http://www.hermesbirkinprice.co
michael kors tote,http://www.michaelkorstotebag.us
michael kors clutch,http://www.michaelkorsclutch.us
Burberry Outlet Online,http://www.burberrybag.us
mcm purses,http://www.mcm-purse.us
mcm purses handbags,http://www.mcm-purse.us
michael kors outlet store,http://www.michaelkorsbagsoutlet.us.com
Louis Vuitton Tote Bags,http://www.louisvuittonshoulderbag.net
MCM Handbags,http://www.mcm-backpack.us
Hermes Outlet,http://www.birkinbaghermes.us
gucci bags outlet,http://www.gucci-bags.us.com
trx for sale,http://trxexercises.us
Longchamp Factory Outlet Online,http://www.longchamp-le-pliage-large.com
uggs for sale,http://www.uggsforwomen.net
gucci handbags outlet,http://www.guccihandbagsoutlet.co
prada handbags sale,http://www.pradahandbags-sale.us
uggs australia,http://www.uggsaustralia.org
Burberry Outlet Online,http://www.burberrybags.us.com
coach bags on sale factory outlet,http://www.coachbagsonsale.us.com
prada loafers women,http://www.prada-loafers.us
Burberry Wallets Women,http://www.burberrywallet.us.com
trx straps,http://trxforsale.us
Cheap Real Gucci Belts for Men,http://www.cheapguccibelts.co
burberry wallet,http://www.burberrywallet.us.com
prada crossbody bags on sale,http://www.prada-crossbody-bag.us
louis vuitton shoes,http://www.louisvuittonshoesmen.net.in
burberry men's wallet sale,http://www.burberrymenswallet.us
gucci bags,http://www.gucci-bags.us.com
vintage chanel bags,http://www.vintage-chanel-bags.co
louis vuitotn speedy,http://www.louisvuittonspeedy30.us.com
Chanel Bag Prices 2014,http://www.chanel-bags-prices.co
Louis Vuitton Bags,http://www.gucci-bags.us.com
louis vuitton messenger bag,http://www.louisvuittonmessengerbag.us
MCM Bags at Macy's,http://www.mcm-bag.us
cheap louis vuitton speedy,http://www.louisvuittonspeedy35.us.com
louis vuitotn speedy,http://www.louisvuittonspeedy25.us.com
louis vuitton eva clutch,http://www.louisvuittonevaclutch.org
black ugg sheepskin boots,http://www.uggsheepskinboots.us
discount louis vuitton purses,http://www.louisvuittonpursesonsale.us
mcm bags,http://www.mcm-bag.us
authentic louis vuitton duffle bag,http://www.louisvuittondufflebag.com
longchamp tote bag outlet,http://www.longchamp-tote.us
burberry wallets for women,http://www.burberrywallet.us.com
michael kors tote bag,http://www.michaelkorstotebag.us
discount michael kors satchel,http://www.michaelkorssatchel.us
michael kors tote,http://www.michaelkorshamiltontote.biz
hermes purses prices,http://www.hermespurses.co
ugg on sale for women,http://www.uggonlinesale.us
michael kors satchel,http://www.michaelkorssatchel.us
ugg outlet,http://www.uggoutletstore.us
louis vuitton neverfull,http://www.louisvuittonneverfullmm.co
hermes birkin price,http://www.hermesbirkinprice.co
Longchamp Backpacks Nylon,http://www.longchamp-backpack.us
Louis Vuitton Shoulder Bag Tote,http://www.louisvuittonshoulderbag.net
chanel crossbody bag,http://www.chanel-crossbody.org
prada crossbody bags,http://www.prada-crossbody-bag.us
michael kors tote,http://www.michaelkorstotebags.us.com
Louis Vuitton Damier Azur,http://www.louisvuittondamier.org.in
Prada Nylon Messenger Bag,http://www.prada-messenge-bag.us
michael kors purse outlet,http://www.michaelkorsblackpurse.com
ugg kids,http://www.uggkidsboots.org
black uggs,http://www.blackuggs.us


wengdongdong

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
wengdongdong
« Reply #9 on: May 30, 2016, 05:19:50 AM »
michael kors
jordan 4 toro
louis vuitton
cheap jerseys
louis vuitton outlet
hollister clothing
christian louboutin outlet
coach outlet
mont blanc pens
polo ralph lauren
cheap oakley sunglasses
fitflops
gucci outlet
polo ralph lauren
nike air huarache
hollister clothing
louis vuitton handbags
cheap ray ban sunglasses
oakley vault
coach outlet online
ralph lauren polo
louis vuitton outlet
coach outlet
louis vuitton handbags
toms shoes
ray ban wayfarer
celine
ray ban wayfarer
longchamp outlet
gucci outlet
coach outlet
adidas stan smith
ray ban sunglasses outlet
true religion shorts
louis vuitton outlet
kate spade
lebron james shoes 2015
cartier watches
coach outlet store online
supra shoes
coach factory outlet
kobe bryant shoes
ray bans
nike outlet store
ray ban sunglasses
coach outlet store online clearances
replica watches for sale
nike air max
toms shoes
nike air max 90
tiffany and co
kate spade
adidas originals
ray ban sunglasses outlet
instyler curling iron
oakley sunglasses wholesale
coach outlet store online
adidas outlet store
ray ban
cheap jordans
coach factory outlet
toms outlet
insanity workout
coach factory outlet
louis vuitton outlet
michael kors outlet
louis vuitton handbags
michael kors uk
air jordan pas cher
michael kors outlet
fitflop sandals
polo ralph lauren
michael kors purses
beats headphones
ed hardy clothing
fitflops sale clearance
nike roshe flyknit
supra sneakers
louis vuitton outlet
true religion jeans
coach outlet
coach outlet
cheap jordans
louis vuitton
fake watches
ray ban outlet
ralph lauren polo outlet
nike basketball shoes
michael kors outlet
coach factory outlet
tory burch sale
hollister clothing store
louis vuitton handbags
mont blanc pens
michael kors outlet
20165.30wengdongdong

dongbei

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: SMF2.0.4 - Error: Subs.php / Array to String Conversion
« Reply #10 on: March 27, 2017, 08:33:38 AM »
This year the wave of flowers is particularly fierce wave of fashion,Coach Factory Outlet fashion circles as if falling into a vast sea of ??flowers.Coach Outlet Whether it is worn on the body or in his hand,Coach Outlet Stores there is a fairy filled with elegant sense.Coach Factory Outlet Those silk clothes do not have to ask the priceMichael Kor Outlet Online , do not have to pursue the brand,Michael Kors Factory Outlet because they look very expensive! Delicate texture,Michael Kors Outlet Store Online even with the most simple cut, can wear clothing you full of stress attitude!Michael Kors Outlet No wonder they all say you are ladies,michael kors outlet onlinebecause you bring their own high tags!Ray Ban outlet We all know that the pilot jacket is the fall and winter of this year's explosion,Coach Outlet online but actually there is a jacket you want to challenge it!true religion jeans Who is such a big courage?Michael Kors Handbags Is the suede jacket!Polo Ralph Lauren Ferry section of the first to be launched is the representative of suede jacket,Coach Handbags Outlet tassel style.Will suede wild style perfect show,Michael Kors US warm tone will exaggerate a sense of convergence.nike air max Small fairies are not recently been the gods of the road too many new clothes know that there must be a sister has been deeply felt to eat soil is not easy,cheap nike shoes today to share with you a few wear skills,air jordan shoes with those who will soon enter the closetOf the winter and summer hand from the few pieces of a single product,cheap air Jordan so that you can also be in the days of the cold days of the United States is not like words.tory burch outlet stores The temperature is caught off guard,tory burch shoes wrapped in a thick coat of winter is not recommended that you put away early,oakley sunglasses dress with a hoodie, style from the winter to the early spring.oakley outlet Get rid of the length of the coat to shorten the length of one coat,ray ban sunglasses reduce the dull.Dress and light style,ray ban outlet and then cold,Coach Bags Outlet then you can also stack high-necked shirt,coach outlet store this time you do not wear a jacket is also a stylish presence.Coach Outlet Fashionable girl has a love and hate imitation fur coat,Michael Kors Outlet Store Online put on a called supermodel, wear bad is the local tyrantsTory Burch Outlet , ah ~ho word crossed,the north face Jackets this season's imitation fur coat changed the past black and white gray conservative Color,Kate spade outlet online into a richer color,Oakley Sunglasses nice to look good,north face outlet but more people do not know how to take it?kate spade outlet store Warm and why thick coat, imitation fur,Coach Outlet Online sweater is also a single product of autumn and winter evergreen,coach outlet store compared to buy a new sweater,Coach Outlet Online Store with a co-ordination of the yarn skirt may have more surprises.Michael kors outlet Profile and texture of the yarn skirt diluted feminine,Coach Outlet Storesweater yarn density and thickness,Salvatore Ferragamo Shoes so you calmly adapt to the cold season when the heat.Chop hand,polo ralph lauren first look at how many pieces of sweater in the end!Pandora Bracelet So, ah, you are in advance to wear summer clothes,Ray Ban Outlet Store and others do not envy,Michael Kors Outlet Store but also shouting clothes is not enough trouble?Polo Outlet Get these little tips,Coach Outlet do not eat soil,adidas yeezy boost 750 to be elegant. You can not big,Red Bottom Shoes you can not burst,The North Face Outlet but you can not do not have a pair of Sneaker!adidas nmd runner Who can think of soil sports shoes can also have today's fashion worth,Cheap Christian Louboutin wild all kinds of tide,cheap true religion outlet even big names are rushing to launch,Kate Spade Outlet Store the future limitless!