@UXbarn: surely, you must use esc_html instead. I fall asleep
Hmm. I don’t think this is what I can use because I need to print out that HTML to be rendered on screen. If I use “esc_html()” for the ”$output” variable, I will get the plain string on screen (escaped HTML).
Are there any reviewers or staff can give a clear answer about this? What method do I need to use to validate the final echo here? Or, in other words, what method to validate the entire “HTML output” when echoing it?
@kotofey: Thanks! I will try that. But for the HTML output, I am not sure whether it is okay to use “esc_attr()” in this case? Will this give the expected result?
@billyf: Actually, my HTML output is dynamically created with conditions in PHP code so that’s why I use variable to store and deal with that before final printing out (or returning it from the function). I think it would be easier to handle and manage the code.
I am interested to know like you too about what is the method to validate the content with HTML tags. Just no idea what to use and how in my case. :-/
I have seen many threads talking about soft rejection with the reason of output validation. In short, the reviewer asks us to check every “echo” to validate the output and they will check for every “echo” to ensure that.
But I still have a question on this. What if I write the code like this:
$text = ot_get_option( 'text_option' ); // From Theme Options $class = ot_get_option( 'class_option' ); // From Theme Options $output = '<span class="' . esc_attr( $class ) . '">' . $text . '</span>'; echo $output;
As you can see that the HTML class is actually validated/escaped in the ”$output” variable. And the ”$output” is just printed out on screen.
So I am wondering that what validation method must I use for the final “echo” of the ”$output” variable?
Can anyone access your ticksy site right now? I just see only the blank page on mine.
Only one cup a day. Loving it while working in the afternoon.
BTW, can anyone give me some tips for drinking coffee without cream and sugar? I did try that for the health purpose but the taste isn’t quite good for me.
Sales seemed normal until … Sunday. It was a disaster.
Try switching to the default WP theme first (eg. Twenty Fifteen) and activate the plugin again.
If the default theme works, then you should contact the Animal Hub theme’s author since there might be something causing that fatal error.
But if it still doesn’t work even with the default theme, so it might be from the other factor. In this case, you can post your question on the plugin’s forum: https://wordpress.org/plugins/contact-form-7/ . Or, try google using the keywords as the plugin name and the error message.