• ok, i’m pretty bad at php, could someone tell me how to add support for img tags into the $allowedtags attribute in kses.php?

Viewing 9 replies - 1 through 9 (of 9 total)
  • edit kses.php as shown in the excerpt from my edited kses.php

    $allowedtags = array(
    'a' => array(
    'href' => array(),
    'title' => array(),
    'rel' => array()),
    'img' => array(
    'src' => array(),
    'alt' => array(),
    'width' => array(),
    'height' => array()),
    'abbr' => array('title' => array()),

    in short, I inserted

    'img' => array(
    'src' => array(),
    'alt' => array(),
    'width' => array(),
    'height' => array()),

    between the ‘a’ and the ‘abbr’ arrays.
    Hope this helped.

    2fargon,
    Is there a possibility you could throw up a version of that exact same code with restrictions set in the width and height of the image?

    Very just question, Chad. /me is curious too.

    I’m speakin out of ignorance, but I would guess that it would look something like:
    ‘img’ => array(
    ‘src’ => array(),
    ‘alt’ => array(),
    ‘width’ => array(300),
    ‘height’ => array(400)),
    Maybe 2fargon will check this post sooner better than later, and verify this.

    I hope anyone does, to be honest.

    Does this need PHP fu or something? I saw that textpattern allows you to set the maximum width, but I don’t know if that was a normal install.

    Has anyone gotten this to work?

    I’d sure love to add images to (at least certain) comments.

    I’ve tried doing this, but it doesn’t seem to work. I keep getting an error.

    Has anyone got this to work, and can put up a txt part of their kses.php please?

    Sproke:

    https://www.ads-software.com/support/topic/69047#post-364059

    Where I suggest placing the ‘font’ tag array, instead you want to insert this line:

    'img' => array('src' => array(), 'alt' => array(), 'width' => array(), 'height' => array()),

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘adding img into kses’ is closed to new replies.