HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

BBCode Where is it translated?

SO I have some posts with BBCode in them IE

[ATTACH=CONFIG]2818[/ATTACH]

But it's only returning "filename.jpg" with a link to the file and not displaying the image at all. I have looking in the library/core/ class.BBCode.php class and from what I can tell in there it should be rendering them as images not links

Comments

  • Options

    NM found the line of code in that file i missed

          if (val('ImageWidth', $media)) {
            return "<div class=\"Attachment Image\"><img src=\"{$src}\" alt=\"{$name}\" /></div>";
          } else {
            return anchor($name, $src, 'Attachment File');
          }
    

    For some reason it is failing the val('ImageWidth', $media) check and returning an anchor. My guess is this is how you tell the difference between an image and a file? And because this property is not here it assumes its a file attachment?

  • Options

    Yeah just looking at all my imported attachments from porter and none of them have image height or width to them set in the Media table so all of them would look like files not images based on this code.. There is a Column called 'Type' in the Media table that for images has the word 'image/jpg' or 'image/png' maybe they should be using that to determine if its an image?

  • Options

    I have submitting a Pull request to solve this issue

    https://github.com/vanilla/vanilla/pull/10354

Sign In or Register to comment.