2020/04/23/Ferreteria: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(navbox)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{box/nav/log}}Some function-library untidiness that is messing with me right now:
{{nav/codeblog}}
[[category:post]]
[[category:ferreteria]]
Some function-library untidiness that is messing with me right now:
* both I/O types (display and storage) involve sanitizing of text  
* both I/O types (display and storage) involve sanitizing of text  
** ...where "santizing" = quoting it and escaping any of the quote-characters that are in it
** ...where "santizing" = quoting it and escaping any of the quote-characters that are in it

Latest revision as of 02:10, 23 November 2021

Codeblog

Some function-library untidiness that is messing with me right now:

  • both I/O types (display and storage) involve sanitizing of text
    • ...where "santizing" = quoting it and escaping any of the quote-characters that are in it
  • display-sanitizing just uses a built-in function, htmlspecialchars()
  • storage-sanitizing, however, is best done by calling a function of the DB engine.
  • ...which involves access to the DB engine object
  • ...which means that I have to pass an object to the Storage classes.
  • ...but there is no equivalent object for the Display classes. So I can't generalize this to IO Collectives; it's only the Storage classes.
  • ...which feels sloppy.

I guess I just need to do it. I could make a Sanitizer wrapper-class, but it doesn't seem worth the effort at this stage.