WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#3857 closed defect (bug) (fixed)

TinyGoogleSpell fails

Reported by: Nazgul Owned by: Nazgul
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.2
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

The TinyMCE spellcheck plugin fails when it tries to use google, with the message "Could not execute AJAX call, server didn't return valid a XML." (which in itself could use some spellchecking)

A network sniffer shows that it is trying to post to http://www.google.com/tbproxy/spell?lang=en, but that returns a 302 to https://www.google.com/tbproxy/spell?lang=en (notice the https)

It seems it's trying to interpret the 302 page as XML, which obviously fails.

Attachments (3)

3857.diff (31.9 KB) - added by Nazgul 9 years ago.
Upgrade tinyspell to 1.0.3.1
3857withfix.diff (32.0 KB) - added by Nazgul 9 years ago.
Same patch with some tweaks for it to work on IIS
3857upstream.diff (1.3 KB) - added by Nazgul 8 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 follow-up: @Otto429 years ago

A newer version of the TinyMCE spell checker exists which may eliminate this issue.

http://prdownloads.sourceforge.net/tinymce/tinymce_spellchecker_php_1_0_3_1.zip?download

It appears to use a more direct approach instead of using the HttpClient class (which does not work).

comment:2 @foolswisdom9 years ago

Ticket #3330 seems to be a duplicate.

comment:3 in reply to: ↑ 1 @foolswisdom9 years ago

  • Owner changed from anonymous to andy

comment:4 follow-up: @novasource9 years ago

I just ran a sniff (WireShark), and the spell check only does port 80 with my blog host. It does not port 80 to any other servers.

comment:5 in reply to: ↑ 4 @novasource9 years ago

Replying to novasource:

I just ran a sniff (WireShark), and the spell check only does port 80 with my blog host. It does not port 80 to any other servers.

Oops, I posted this to the wrong ticket. While it's kind of relevant, I meant it for 3857.

@Nazgul9 years ago

Upgrade tinyspell to 1.0.3.1

comment:6 @Nazgul9 years ago

I did some more testing/debugging.

My error log showed:

[28-Feb-2007 23:15:58] PHP Notice:  Use of undefined constant PSPELL_FAST - assumed 'PSPELL_FAST' in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\config.php on line 13
[28-Feb-2007 23:15:58] PHP Notice:  Undefined index:  mode in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 36
[28-Feb-2007 23:15:58] PHP Notice:  Undefined index:  spelling in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 37
[28-Feb-2007 23:15:58] PHP Notice:  Undefined index:  jargon in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 38
[28-Feb-2007 23:15:58] PHP Notice:  Undefined index:  encoding in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 39
[28-Feb-2007 23:15:58] PHP Notice:  Undefined index:  sg in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 40
[28-Feb-2007 23:15:58] PHP Notice:  Undefined property:  errorMsg in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 86
[28-Feb-2007 23:16:08] PHP Warning:  Cannot modify header information - headers already sent by (output started at D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\config.php:13) in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\tinyspell.php on line 111

After I upgraded to version 1.0.3.1 of tinyspell (patch attached) I "upgraded" to this list of errors:

[28-Feb-2007 23:24:59] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: no SSL support in this build in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\classes\TinyGoogleSpell.class.php on line 82
[28-Feb-2007 23:24:59] PHP Warning:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to www.google.com:443 in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\classes\TinyGoogleSpell.class.php on line 82
[28-Feb-2007 23:24:59] PHP Fatal error:  Call to undefined function:  curl_init() in D:\Development\WordPress\SVN\wp-includes\js\tinymce\plugins\spellchecker\classes\TinyGoogleSpell.class.php on line 95

So I managed to change and reduce the number of errors, but it's still not working. But I have some more ideas...

@Nazgul9 years ago

Same patch with some tweaks for it to work on IIS

comment:7 @Nazgul9 years ago

  • Keywords has-patch dev-feedback added

I got it to work (sort of).

I couldn't get fsockopen with ssl to work on Windows, so I installed curl on my machine and made a small change to the code that it will use curl instead of fsockopen when available. This makes it work on Windows as long as curl is installed, but it will still fail if it isn't.

After that change I encountered another issue. The new spellcheck version introduces a dependency on the mbstring extension (which I ofcourse haven't installed) so I made a small change so it will use mb_substr when available or fall back to normal substr when it isn't.

After that spellcheck was working for me. I attached another patch which upgrades spellcheck to 1.0.3.1, but also contains my changes.

Only downside is that it will still fail on Windows servers without curl. Anyone have a solution for that?

comment:8 follow-up: @Otto429 years ago

What's your version of PHP? I'm seeing numerous reports of problems with some versions of PHP 4.3.x on Windows. Apparently there are/were bugs in many builds that require replacing various DLLs to do fsockopen to ssl connections.

I'm not seeing any PHP5 issues along these same lines, however.

comment:9 in reply to: ↑ 8 @Nazgul9 years ago

Replying to Otto42:

What's your version of PHP?



From my phpinfo():

PHP Version                        4.4.5
System                             Windows NT AMD3500 5.1 build 2600
Build Date                         Feb 13 2007 22:09:09
Server API                         CGI/FastCGI

comment:10 @ryan8 years ago

[4985] updates spellechecker to 1.0.3.1. Let's base patches off of that and get fixes upstream to moxie.

comment:11 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

@Nazgul8 years ago

comment:13 @Nazgul8 years ago

  • Keywords dev-feedback removed
  • Owner changed from andy to Nazgul
  • Status changed from new to assigned

Replying to Nazgul:

Submitted the bugs upstream:
https://sourceforge.net/tracker/?func=detail&atid=635682&aid=1691693&group_id=103281

This one has been fixed upstream. See:
http://tinymce.svn.sourceforge.net/viewvc/tinymce/spellchecker_php/trunk/classes/TinyGoogleSpell.class.php?r1=149&r2=247

I've attached a diff with those changes for inclusion in Wordpress.

Could we get this in for 2.2?

comment:14 @ryan8 years ago

(In [5214]) Google spell connect fix. Props Nazgul. see #3857

comment:15 @ryan8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

I believe this is fixed with the latest spellchecker updates.

Note: See TracTickets for help on using tickets.