helios-ag / FMBbCodeBundle

:capital_abcd: BBCode bundle for Symfony projects
Other
57 stars 35 forks source link

[code] Crash #138

Open Strategy47 opened 8 years ago

Strategy47 commented 8 years ago

Hi,

I have a probleme with the [code] tag. It seems that if the code posted is too long, the process crashes.

My config:

fm_bbcode:
    filter_sets:
        forum:
            strict: false
            locale: %locale%
            xhtml: false
            # see https://github.com/milesj/decoda/tree/master/src/Decoda/Filter
            filters: [ default, code, image, list, quote, url]

An exception has been thrown during the rendering of a template ("Warning: Missing argument 1 for Decoda\Hook\AbstractHook::beforeParse(), called in /home/ircz/www/IRCz/vendor/mjohnson/decoda/src/Decoda/Decoda.php on line 1648 and defined") in ForumBundle:Post:single-post.html.twig at line 36.

Full Error: http://pastebin.com/ddnnPLR8 my view: {{ post.content|bbcode_filter('forum') }}

And dump post.content :+1:

[code="tcl"]#   SySteM IRC Service\n
# ====================\n
#    Auteur: Diogene\n
# ====================\n
#      irc.mod.tcl\n
# ====================\n
\n
namespace eval irc {\n
    variable ircd\n
    set ircd "inspircd"#Cette variable est inutile pour ce bout de code\n
}\n
\n
proc irc::linkCreate {sockID name passwd desc sid} {\n
  puts $sockID "SERVER $name $passwd 0 $sid :$desc"\n
  puts $sockID ":$sid BURST [clock seconds]"\n
  puts $sockID ":$sid ENDBURST"\n
}\n
\n
proc irc::botCreate {sockID nick ident host real sid uid chan} {\n
  puts $sockID ":$sid UID $uid [clock seconds] $nick $host $host $ident $host [clock seconds] +Siosw +ABCKNOQcdfgklnoqtx :$real"\n
  puts $sockID ":$uid JOIN $chan"\n
  puts $sockID ":$uid MODE $chan +o $nick"\n
    \n
}\n
\n
proc irc::srvEvents {sockID data sid} {\n
  puts $data  \n
  switch -exact [lindex $data 1] {\n
     "PING" {\n
\t    puts $sockID ":$sid PONG $sid :[lindex $data 2]"\n
     } \n
  }\n
}[/code]
alquerci commented 8 years ago

Hello @Discutea

I report this bug to Decoda. It come from https://github.com/milesj/decoda/blob/974bbda/src/Decoda/Decoda.php#L1648

Strategy47 commented 8 years ago

thanks