q2a/question2answer — pull request #64 by pupi1985 (2014-08-02 19:18:11+00:00)
Title: Fixed an issue that allowed null title and content in posts

This fixes bug #63. I'm not sure why there is an explicit null check there but I guess it was just a miss.

Although the issue isn't serious I noticed that questions created this way have not title when displayed in lists and no url associated. This leads to the following logs:
```
PHP Notice: Undefined index: url in qa-include/qa-theme-base.php on line 1477, referer: http://q2a.com/429/
PHP Notice: Undefined index: title in qa-include/qa-theme-base.php on line 1477, referer: http://q2a.com/429/
```
Now, although this should fix future posts what should be done with the old posts stored with null title and/or content? Based on the fact that `qa-theme-base.php` is clearly not ready to handle null values I will have to assume that null values shouldn't be allowed in title and content and an empty string should be preferred. This, of course, contradicts the fact that both columns allow null values in them.
So, IMO, in order to avoid adding checks everywhere about null content, I would alter the ^posts table:
```
ALTER TABLE ^posts
CHANGE COLUMN title title VARCHAR(800) NOT NULL DEFAULT '',
CHANGE COLUMN content content VARCHAR(8000) NOT NULL DEFAULT '';
```
I believe current users would benefit from this fix and could perform the changes manually. I would happily post it to the QA site (not the alter table, just the PHP code!). However, maybe @svivian should be the right person to do so.

As usual, this could be added (relatively soon?) to a 1.6.4 release.