Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Why doesn't this work with images?

ZhaanZhaan Professional fool ✭✭
edited September 2013 in Vanilla 2.0 - 2.8

This plugin works occasionally on my forum, but only for text. When I attempt to hide images, it just breaks and the spoiler tags become visible. Do any of you know what could be causing this?

EDIT: My forum uses BBCode and Button Bar, by the way.

Comments

  • peregrineperegrine MVP
    edited September 2013

    kindly provide this:
    http://vanillaforums.org/discussion/comment/189479/#Comment_189479

    aside from clicking on the link above, can you post a screenshot of an example that "breaks".

    attached images and/or inline images.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • ZhaanZhaan Professional fool ✭✭
    edited September 2013

    Ah sorry about that, I usually don't forget to mention my vanilla version! I'm on 2.1b.

    By breaking I just mean that it doesn't actually produce a spoiler button, it literally just displays the tags like this as if nothing happened:

    [img]link[/img]

    It is weird though, because it does sometimes work (on rare occasions) and I have no idea why.

  • hgtonighthgtonight ∞ · New Moderator

    So the source markup is shown?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • are you saying the spoiler works completely correctly if there is no image in the post??
    or just breaks down with images.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • ZhaanZhaan Professional fool ✭✭
    edited September 2013

    Yep, it only works with text.

    @hgtonight Indeed.

  • peregrineperegrine MVP
    edited September 2013

    what version of spoilers - is there an updated version in github by chance?

    since it is a plugin developed by vanilla crew and you are testing 2.1bx (still you have supplied unknown version, multiple versions of 2.1b1 and 2.1b2)

    thanks for mentioning partial Vanilla version in response to which Vanilla version question. It is also great to mention plugin version too (just for completeness).

    you could file an issue on github

    and the moderator could change title to say 2.1bx

    sure would be great if people testing in 2.1 actually mentioned it in the first discussion or title, it would certainly make things quicker. I spent time looking at 2.0.18.8 prior to your mention of version, but its not worth my effort to go from version to version to test as little pieces of info filter through.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • it would actually be much more useful if people provide repeatable step or an actual real example.

    Seems to work just fine

    php > function T($Str){return $Str;}
    php > function SpoilerCallback($Matches) {
    php { 
    php {       $Attribution = T('Spoiler: %s');
    php { 
    php {       $SpoilerText = (sizeof($Matches) > 2) ? $Matches[2] : NULL;
    php { 
    php {       if (is_null($SpoilerText)) $SpoilerText = '';
    php { 
    php {       else
    php { 
    php {          $SpoilerText = "<span>{$SpoilerText}</span>";
    php { 
    php {       $Attribution = sprintf($Attribution,$SpoilerText);
    php { 
    php {       return <<<BLOCKQUOTE
    <<< > 
    <<< >       <div class="UserSpoiler"><div class="SpoilerTitle">{$Attribution}</div><div class="SpoilerReveal"></div><div class="SpoilerText">
    <<< > 
    <<< > BLOCKQUOTE;
    php { 
    php {    }
    php >  var_dump(str_replace('[/spoiler]','</div></div>',preg_replace_callback("/(\[spoiler(?:=\"?([\d\w_',.? ]+)\"?)?\])/",'SpoilerCallback', '<div class="Spoiler"><img src="http://someweb.com/some.gif" /></div>')));
    string(185) "
          <div class="UserSpoiler"><div class="SpoilerTitle">Spoiler: </div><div class="SpoilerReveal"></div><div class="SpoilerText">
    <img src="http://someweb.com/some.gif" /></div></div>"
    

    There is a saying "If it is not reproducible it doesn't exist". So as far as bug testing this bug doesn't exist ATM

    grep is your friend.

Sign In or Register to comment.