Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.6k views
in Plugins by
edited by

hello 

 

i got this problem after update Q&A Script  and add CKEditor4 Editor and seo plugin

 

i got this msg from email when anyone answer me

 

i think the problem from using CKEditor4 Editor !!

 

 

by
Thanks maxj. Since CKEditor is not related to email encoding, there may be any other conditions. If other plugins become clear, cause may be found. e.g. Q2A-Ultimate-SEO / Q2A-SEO-Links
Keyword for investigation:
overrided qa_sanitize_html() / qa_html_convert_urls() function?
(I do not have confidence...)
by
Perfect. I added and enabled that plugin (Seo-links) to my test-case and I was able to reproduce the issue that you have.
by
Same behaviour using the default wysiwyg editor or the CKEditor4 plugin.

2 Answers

+1 vote
by
edited by

i try to solve it using this config

 config.language = 'ar';

it is work without any html tag

but when i am use any tag like

<p><span style="font-family:tahoma,geneva,sans-serif;">يمكنك تجربة خاصية الانبوكس عبر هالرابط</span></p>

the problem is not solve :(

 

+1 vote
by
edited by

Ok, as said in the comments I've reproduced the issue.

It arises using the current codeline of Q2A-SEO-links, and it's not due to the CKEditor4 plugin.

Solutions :

1) (quick&dirty)

temporarily remove the Q2A-SEO-links plugin from your

[q2a-root]\qa-plugin\

folder

(and wait for a patch for it)

2) apply the following patch (that I've used and seems to work in my test-case) :

change this line inside the qa-seo-links.php file

from :
$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), $dom->saveHTML()));
to :
$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), html_entity_decode($dom->saveHTML(),ENT_QUOTES,'utf-8')));
In my test case it solves the problem.

However keep in mind that I'm not the developer of the plugin ( nor I'm a php developer ! smiley).

So the right way in both cases should be that of waiting for the official patch smiley

 

EDIT :

deleted the previous instruction :

$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), html_entity_decode($dom->saveHTML(),ENT_QUOTES,$encod)));

(see the comments below)

by
I'll file a new issue on the github repository too
by
solve but i got this problem
html_entity_decode(): charset `ASCII' not supported, assuming utf-8
by
anyway thanks for ur replay many times :)
i try to change coding to utf and dofollow not work after that !!
by
You are right, there is a warning, I can see it on my log too.
Try to use this line :

$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), mb_convert_encoding($dom->saveHTML(),$encod,'HTML-ENTITIES') ));

instead of the second one in my answer above. Now the warning should disappear.
Let me know.
by
the text become like this ????? ?? ?????? ???? ?? ???????? ?????? ??

:)
by
edited by
Mmmm... That works for me....
Just to know, does this work for you ?

$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), html_entity_decode($dom->saveHTML(),ENT_QUOTES,'utf-8')));

Edit : utf-8 lowercase (vs UTF-8)
by
Sorry i was travle to another country , the mail work fine now but the script not work , it give me nofollow for same domain url :)
by
Mmmm... I've just done quickly some tests, with and without the instruction above,
and, if I'm not wrong, I can see  that behaviour (nofollow for internal links) also in the original plugin..... And only "sometimes" (I've not yet understood the problematic use case).
I think that's another issue.... that I see also in the original plugin.
Now are you using the original plugin or the modified one ?  (that is the plugin using the last instruction above)
by
yes it is the original :)
by
I'm not very good in reading a post in arabic language :-)
but if you see the answer to this post :
http://soualwjoab.com/5600/
the internal link is generated with a nofollow relationship....
So, if you are using the original plugin, pls check if you have selected the option "Convert all internal link relations to DOFOLLOW" too.....
Do you have it selected or no ?

ps
while in the answer to this post
http://soualwjoab.com/5591
the internal link has (correctly) a dofollow relationship
by
some link convert to dofollow other no , it is "Convert all internal link relations to DOFOLLOW " already
by
Thanks, this confirms my findings.
There are 2 different issues :

Issue 1)
the one you opened with this question : notifications sent by email contain wrong chars.

Issue 2)
internal links' relationship conversion : there are some use cases in which it does not work.

Solutions :

Issue 1)
see my comments above. Change line 73 of the  qa-seo-links.php file
from :
$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), $dom->saveHTML()));
to :
$safe = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), html_entity_decode($dom->saveHTML(),ENT_QUOTES,'utf-8')));

Issue 2)
I've not idea :-)

However I'll have a look into issue 2) too, but I think it must be kept *separate* from this "thread", where we are talking about another issue, that in my opinion is now solved :
see the solution above to the "Issue 1)".

If you agree I would close this thread :-)
by
I've updated my answer
by
it is okey ,
thanks for replay
...