Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
573 views
in Q2A Core by
retagged by

Just wanted to let you know that some of my users are reporting that their content gets lost.

I have checked their posts and indeed it is EMPTY. Empty string!

It confuses me because I thought this would not be possible - posting with 0 letters should be prevented. Any clue?

Note:
1. The question title is transferred, the tags too.
2. I am using SCeditor.
3. no error_log

---

Update: I converted a question with empty content to a comment, then I got:
PHP Notice:  Undefined index:  content in qa-include/qa-theme-base.php on line 2328 - should an empty content not be caught?

Q2A version: 1.7.1
by
Happened again, but this time title AND content got cut. Title: "Zeigen Sie, dass " and content: "<p>Es seien ". I deactivated my main filter plugin to make sure it is not that one.
by
I am still trying to find out about the error cause. The user reported he copied from a PDF. That reminds me of http://www.question2answer.org/qa/22644/bug-rss-feed-breaks-on-certain-character --- maybe a certain character is responsible for the full content cut?!
by
Is this when asking questions, or answering, or both? Does the same problem occur with another editor (e.g. the default CKeditor)?

This may already be partly fixed as I made some changes recently to prevent blank content in some circumstances. The 'undefined index' notice should also be fixed.
by
It happened only with the question until now. I guess my regular users do not copy from PDF files and get invisible control characters (I am thinking they cause the problem). Weird, btw, that I copied the same PDF the user mentioned and it worked right away. That is why I have asked the user to tell me about his PDF reader - no answer yet. It could also be the new browser "Microsoft Edge" but also not sure how the empty content could pass and the cut content could happen.

For the fixes, do you mean: https://github.com/q2a/question2answer/commit/7f65de542725071522e036508e3519353509b020 ? The !empty() was IMO better because the isset() will let through even if the $content is an empty string, as far as I know. Can you point to the fixes - or should I just download the entire package from github and put it on my server?
by
No, that line is fixing the notices that appear if blank content happened to get through. empty() does not ensure there is content as the string of '0' is classed as empty. I think the changes may be on the 1.8 branch.

But I don't think those changes would fix the issue entirely, because something else is truncating the content. Do you have a link to the SCeditor so I can try? Thanks.

Please log in or register to answer this question.

...