Plugin development question...

I'm having trouble with a custom plugin I'm working on. One of the admin options needs to be a RegEx string, but even when using OPTION_TYPE_CLEARTEXT, anything between angle brackets disappears. What is the preferred way to allow text entry that is not cleansed, parsed, or stripped in any way?

Comments

  • ...follow-up: I see that the data is correct in the database, so the value appears to be getting saved correctly. But the value is "cleansed" when re-displayed in the admin plugin options.
  • Are there HTML characters in the string? Then the string must be htmlspecialchar'ed for display. That really ought to be happening so I guess there is a bug somewhere. Can you provide more details of what you are doing?
  • I made a plugin to show random quotes from a text file I'd used on a previous site. I think I pretty well followed all the guidelines, CSS styling best practices, and made some configurable options (namely the quotes filename). It occurred to me, based on work I'd done on former sites that mixed apps such as phpBB and Gallery2, phpBB and Mantis, or other combinations of apps that a single quotes file might be used by different apps/themes, so I figured I'd better make it configurable.

    Of course, then I realized that there are many existing quote files out there that people might want to use, and they probably use a different format than the one I have. So, I thought I'd make a configurable RegEx expression to parse individual lines.

    Arguably, most users would find reformatting a large text file rather simple compared to the task of writing a RegEx, but I digress :-) That, and I could always post a list of common ones for different common quote file formats (if there are any?).

    Anyhow, after sufficiently over-thinking the problem and over-complicating my task, I find myself in need of putting a RegEx expression in a text field for the plugin option.

    It does seem like a bug, since the CLEARTEXT option implies that it will not be screwed with. But while displaying HTML would process formatting, this shouldn't happen in a text box. So, it does seem like it might be a bug in the code for displaying those fields. I might get a chance to dig through it over the next couple of days.
  • The change you just posted to the trunk seemed to fix it - thanks!
  • Thanks for the confirmation. There may be other places like this. If you notice one, please say so.
Sign In or Register to comment.