Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Ping of Article Errors Out #1005

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

Tried to Send Ping for the Beta 3 article on Geeklog.net and got this error (actual this error is from my development server). I believe pinging was working in Beta 2 (as I believe I pinged the Beta 2 article) so it looks like this error was created from code changes for Beta 3. The XPC class has not changed in a while so I am wondering if it is from this composer library update: https://github.com/Geeklog-Core/geeklog/commit/dd48d7e599d3d401c57b2e495a4f1825b5e17688

E_WARNING(2) - in_array() expects parameter 2 to be array, null given @ C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php line 441
Call Stack
#   Function    File    Line
1   in_array    C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php    441
2   startElement        
3   xml_parse   C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php    1726
4   parseResponse   C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php    1658
5   parseResponseFile   C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php    1160
6   sendPayloadHTTP10   C:\inetpub\GitHub\geeklog\system\classes\XML\RPC.php    1054
7   send    C:\inetpub\GitHub\geeklog\system\lib-pingback.php   165
8   PNB_sendPing    C:\inetpub\GitHub\geeklog\public_html\admin\trackback.php   333
9   sendPings   C:\inetpub\GitHub\geeklog\public_html\admin\trackback.php   924

array(6) {
  ["parser_resource"]=>
  resource(13) of type (xml)
  ["name"]=>
  string(6) "PARAMS"
  ["attrs"]=>
  array(0) {
  }
  ["XML_RPC_xh"]=>
  &array(1) {
    [13]=>
    array(8) {
      ["cm"]=>
      int(0)
      ["isf"]=>
      int(0)
      ["ac"]=>
      string(3) "
  "
      ["qt"]=>
      string(0) ""
      ["stack"]=>
      array(1) {
        [0]=>
        string(14) "METHODRESPONSE"
      }
      ["valuestack"]=>
      array(0) {
      }
      ["ha"]=>
      string(145) "HTTP/1.1 200 OK
Server: nginx
Date: Tue, 03 Dec 2019 16:44:39 GMT
Content-Type: text/xml;charset=utf-8
Content-Length: 360
Connection: close"
      ["lv"]=>
      int(0)
    }
  }
  ["XML_RPC_valid_parents"]=>
  &NULL
  ["parser"]=>
  int(13)
}
eSilverStrike commented 4 years ago

@mystralkk – Another issue that is a pain to debug and has taken me a long time to figure out.

Anyways I have it working again I think. (not sure about Trackbacks and pingbacks)

I ended up grabbing the latest 1.5.5 version of the XML RPC class released in 2011 from

https://pear.php.net/package/XML_RPC

And then using PHP 7.3 I updated the code until it worked.

I see you did a number of changes here a while back to make it work with PHP 7.3 but I am not sure which version you started with

https://github.com/Geeklog-Core/geeklog/commit/7124351cabb6fb1dcc7b382527da5253159fbaec#diff-fe65e5e7f3f224782110d41044d1d92c

There are lots of things like removing

require_once 'XML/RPC.php';

from

system/classes/XML/RPC/Server.php

which I didn’t do as I never got an error from it pinging.

NOTE: I didn’t try trackbacks or pingbacks these are virtually dead and I have nothing setup to do this.

Should I commit what I have or did you want to take a look at the error with the existing code?

The XML RPC class seems to be only used by pinging, trackback, and pingback (does any plugins use this???)

The XML RPC class we have in Geeklog is really old and the recommended one is now

https://pear.php.net/package/XML_RPC2

What do you think we should do?

We do have issue #836 which is about dropping trackbacks and Pings which is something I think we should do in the next version of Geeklog (which would mean also getting rid of the XML XPC class which would solve all these problems…

Thoughts?

mystralkk commented 4 years ago

I don't have enough time to test things, so why don't you commit your fixes?

eSilverStrike commented 4 years ago

Will do. Not to worried especially since we will be removing this stuff later. Plus the siteindex plugin is how search engines are notified now.

eSilverStrike commented 4 years ago

Okay stuff tested as far as I could go while not being able to actually creating a trackback or sending a successful pingback (since I don't have another site setup to do this testing with).

Should really consider removing this stuff soon #836