WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/31/2008 04:01:30 AM (13 years ago)
Author:
azaozz
Message:

Latest TinyMCE, has new load options and bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/rpc.php

    r6632 r8512  
    11<?php
    22/**
    3  * $Id: rpc.php 354 2007-11-05 20:48:49Z spocke $
     3 * $Id: rpc.php 822 2008-04-28 13:45:03Z spocke $
    44 *
    55 * @author Moxiecode
     
    5252    die('{"result":null,"id":null,"error":{"errstr":"Could not get raw post data.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');
    5353
     54// Passthrough request to remote server
     55if (isset($config['general.remote_rpc_url'])) {
     56    $url = parse_url($config['general.remote_rpc_url']);
     57
     58    // Setup request
     59    $req = "POST " . $url["path"] . " HTTP/1.0\r\n";
     60    $req .= "Connection: close\r\n";
     61    $req .= "Host: " . $url['host'] . "\r\n";
     62    $req .= "Content-Length: " . strlen($raw) . "\r\n";
     63    $req .= "\r\n" . $raw;
     64
     65    if (!isset($url['port']) || !$url['port'])
     66        $url['port'] = 80;
     67
     68    $errno = $errstr = "";
     69
     70    $socket = fsockopen($url['host'], intval($url['port']), $errno, $errstr, 30);
     71    if ($socket) {
     72        // Send request headers
     73        fputs($socket, $req);
     74
     75        // Read response headers and data
     76        $resp = "";
     77        while (!feof($socket))
     78                $resp .= fgets($socket, 4096);
     79
     80        fclose($socket);
     81
     82        // Split response header/data
     83        $resp = explode("\r\n\r\n", $resp);
     84        echo $resp[1]; // Output body
     85    }
     86
     87    die();
     88}
     89
    5490// Get JSON data
    5591$json = new Moxiecode_JSON();
Note: See TracChangeset for help on using the changeset viewer.