I found the documentation for regular expressions at php.net.
I read somewhere on the internet to use the pattern modifiers “msU” to match multiline content, but while I understand the ‘m’ and the ‘s’ I don’t understand the ‘U’ very well. I’m not sure what it means to be greedy or ungreedy exactly. But I’ve been using msU pattern modifiers in my regexps that parse the phpjs.org content for import into jsphp.co.
I found the documentation on missing functions at phpjs.org. I wrote some code to import these functions too, and now I’m modelling “port status” on functions at jsphp.co, where the port status can be any of: Ported, Unported, Not porting, Experimental or Workbench.
I found out about a PHP function uniqid. You can see an example of its output on my test page.
Other functions that I’ve learned recently are usort, create_function and strcasecmp.
I also learned that if you want to link to the PHP function documentation you can use a link in the form http://php.net/function_exists where ‘function_exists’ is the function name you’re interested in.
I’ve been putting view code in my object models and not feeling the least bit bad about it.
You can see here, and scroll down a bit to find the view links section. Then scroll a little further for other examples of view code in the models.
If it’s wrong, then why does it feel so right?
Ran across this article, Using AutoComplete in HTML today while looking up how to disable autocompletion.
I had to use the CSS z-index property today to fix up a problem I was having with the YUI Html Editor, whereby my popup menus were rendering behind it. Everything is easy once you know how!
I found out about the HTMLPurifier today. A HTML sanitisation library for PHP. Handy!
I’m using Doctrine 2.1, and the only documentation I could find for column types in Doctrine was in the 1.2 documentation. I’ve been trying to use the ‘clob’ data-type that is listed there, but haven’t had any luck getting it to work. So what I’ve done instead is to use a ‘string’ data-type and override its columnDefinition with something like this:
@Column(type="string", nullable=false, columnDefinition="TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL")
It’s a pain because that causes the database updating script below to output column changes every time it is run:
php %doctrine% orm:schema-tool:update --dump-sql > update.sql
While playing with CodeIgniter I bumped into its xss_clean function. Found this article on StackOverflow that discusses its use. Basically I don’t think I’ll be using it, rather I will be HTML encoding my data for inclusion in HTML output. Still have the sticky issue of what to do with comments, because in comments I allow for HTML. Maybe xss_clean will be useful there..? I’ll look into it a little more further down the track.
Been reading about Cross-site scripting today on Wikipedia just to see if there was anything I didn’t already know. I’m in the process of code reviewing the entire Pcphpjs code base to remove all the XSS vulnerabilities that I left latent while hacking it together and learning the CodeIgniter and Doctrine frameworks. Now things are relatively stable so I’m going to go over the whole thing and refactor it with a view to code reviewing data handling for HTML injection while I’m at it.