Swift Mailer stopped working after update to PHP 8.1 - smtp

I recently updated PHP version on our server to 8.1.11, and SwiftMailer stops working. Specifically, this function causes a HTTP 500 error on the page:
$transport = Swift_SmtpTransport::newInstance("smtp.gmail.com", 465, "ssl")
-> setUsername($row["email"])
-> setPassword($row["password"])
;
There's no reason to believe the server or email details are incorrect. It's something to do with the function call itself. A Swift Mailer help article directed me here.
Anyone know what I need to do?

Related

MediaWiki, trying to investigate VisualEditor "Error contacting the Parsoid/RESTBase server (HTTP 500)"

A lot of people have the same error for many different reasons, so, after trying a composer update, I've tried to investigate it starting from the browser and reconstructing step by step what is happening. It's really hard for me and I would really appreciate help from a PHP Developer!
From Chrome Developer Tools I could find the Ajax request in the background and the called url on the server
By playing with the url I realized that changing the action name returned a different error code, which let me understand that the current call is just a generic API in the middle between the browser and whatever is "apierror-visualeditor-docserver-http"
The Ajax call
{mysite}
/ api.php
? action=visualeditor
& paction=parse
&page=Cosa_c%27%C3%A8_da_fare%3F
Example
https://www.tematichedigenere.com/api.php?action=visualeditor&paction=parse&page=Cosa_c%27%C3%A8_da_fare%3F
The response from the Ajax call
The serverside call to rest api
Then I can see from the Apache server's log that the api page contacts the following url (returning 500)
GET
//rest.php/
{mywebsiteurl}
/v3/page/html/
Cosa_c%27%C3%A8_da_fare%3F/27246
?redirect=false
&stash=true
example
"GET //rest.php/www.tematichedigenere.com/v3/page/html/Cosa_c%27%C3%A8_da_fare%3F/27246?redirect=false&stash=true HTTP/1.0" 500 5621 "-" "VisualEditor-MediaWiki/1.38.2"
Another example of log (returning 404)
{an IP} - -
[04/Dec/2022:14:16:12 +0000]
"POST
/rest.php/
{mywebsiteurl}/v3
/transform/html/to/wikitext
/Riflessioni_sulla_sessualizz._femm._collegate_-_bozza%2Fprova
HTTP/1.0"
404
467
"-"
"VisualEditor-MediaWiki/1.38.2 X-Middleton/1"
Maybe the initial double / is wrong?
Anyway if I call the uri directly from my browser https://tematichedigenere.com/rest.php/www.tematichedigenere.com/v3/page/html/Cosa_c%27%C3%A8_da_fare%3F/27246?redirect=false&stash=true
The server does a antirobot check but I'm not sure that was the problem.
I've realized that the 500 error code hides a more complex real error which is returned by accessing directly the url from the log.
As you say, the visualeditor API is mostly just a proxy to the Parsoid API. The double / is wrong (check your $wgVirtualRestConfig settings maybe), I don't think it actually matters though. The error sounds like you are using incompatible library versions - make sure MediaWiki core and the VisualEditor extension are for the same release, and that the parsoid Composer library is up to date.
Update from OP:
the issue was solved. I simply had to delete the folder /vendor/wikimedia/parsoid and copy it from the fresh install. I couldn't see there were disalignment because of a problem in the compare tool. I got a lot of help in the IRC channel (not in Phabricator and not in Mediawiki forums, it seems IRC is really helpful for MW products).

'Unspecified certificate from client' error received from Delphi THTTPClient post request in ver 10.3.1 but not 10.3.2

As the title suggests, I'm receiving this error when trying to make a simple POST request via a THTTPClient in Delphi and the connection isn't completed so I get no response:
lHttpResp := FHTTP.Post(
'https://url123/',
jsonToSend,
nil,
[
TNetHeader.Create('content-type', 'application/json;charset=utf8'),
TNetHeader.Create('accept', 'application/json;charset=utf8')
]);
This call works without an issue when built with Delphi 10.3.2 / Windows 10.
I thought perhaps copying the 10.3.2 \Embarcadero\Studio\20.0\source\rtl files to the 10.3.1 machine might have done the trick, alas it didn't.
Upgrade is an option, however it would be nice if there was a simple code fix/work around for 10.3.1.
Edit: I thought this might help, however it didn't: Unspecified certificate from client when using TRESTRequest
How do I get this working in 10.3.1?
The solution is to just upgrade to a version >= 10.3.2

Issues with MantisBT and PhpStorm

I happily used PhpStorm and MantisBT together for months, but now I'm facing a strange problem.
Trying to establish a connection to my mantis instance (self hosted), I get the error:
Request failed. Reason: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
While I understand, what this error message means, I can't tell why it happens and I can't control the response I get from Mantis.
I neither found answers at the PhpStorm docs nor at Google nor at the Mantis bug tracker itself.
So I want to try my luck here. Is anyone else experiencing this or could give some advice?
Thanks to #user10550971 comment, I found the issue. The link to check if SOAP is enabled or not mentioned, that the PHP Soap extension was missing.
Although I would have sworn, that I didn't make any changes at server side, I did.
I updated my PHP version and forgot to install SOAP.

Appcelerator message = "JSON Parse error: Unexpected identifier \"undefined\"";

I am adding new features to an app I wrote last years and is working now ... I just port the code from Appcelerator (3.2...) to the Appcelerator Studio 5.2.0.GA SDK ... and I have spent 2 days trying to figure out why code that currently works on an app in the app store is not working in the SDK 5.2.0 environment
I keep getting the above error .. I am positive the url is correct and working
This line of code works now in the app in the store and in 3.1... but is not working in 5.2.0
var jsonObject = JSON.parse(this.responseText);
It gives the above error
"JSON Parse error: Unexpected identifier \"undefined\"";
I have read their site and searched for a solution ... Thanks
entire Block
Try one thing:
Open this site and put your response data in which you are getting error https://jsonformatter.curiousconcept.com
After parsing the same data on the above site, you can check whether the problem is really in your Titanium code or in your data.
Also check whether you are really getting any response data or not.
If it does not help, then please share some necessary source code
Thanks

Facebook SDK works on PHP 5.2, not on 5.3

I'm having a terrible time of it trying to implement the Facebook PHP SDK on a new server. I'm running the following code:
require('facebook.php');
$facebook = new Facebook(array(
'appId' => "###",
'secret' => "###",
));
$signed_request = $facebook->getSignedRequest();
$like_status = $signed_request["page"]["liked"];
if ($like_status) {
include('fan.php');
}
else {
include('visitor.php');
}
This all works perfectly under my server running PHP 5.2.17, but breaks under PHP 5.3.3. Both servers have cURL and JSON functioning properly. As far as I can tell, no errors are being thrown, but $facebook->getSignedRequest(); is returning as null.
I'm almost certain that there's something in my server configuration that's bollocksing the whole thing up, but for the life of me I can't figure out what. Any help would be greatly appreciated. Thanks in advance!
I looked into the FB PHP SDK, getSignedRequest method and it used the $_REQUEST superglobal, the PHP manual says that in
5.3.0 - Introduced request_order. This directive affects the contents of
$_REQUEST.
Either the values of $_REQUEST are overwritten somehow. This might be something to look into.