Redirect to index
Redirect to the paste
PDO : pgsql
Php error : PHP Warning: strlen() expects parameter 1 to be string, resource given in path/privatebin/lib/Data/Database.php on line 250
Server address: http://privatebin.delurk.com
Server OS: Debian 8
Webserver: Apache 2.4.10
Browser: Firefox Developer Edition 54
PrivateBin version: Release 1.1
That's interesting. I could reproduce the issue on your server. However, there is no real redirect, it just shows the home page instead of loading the paste…
Did you try another database/storage system, so is it connected to the database you use?
The error points to this line indicating that it might be connected to attachments.
var_dump($paste);exit; (temporarily) before line 240 in the file with the error, which should output the content of the paste.I assume the data PrivateBin cannot save the data in your database correctly…
I didn't try another storage system.
Okay, could you please revert 3.?
Are you still using the filesystem based storage? If so could you just confirm, this storage method works and then switch back to the problematic database storage?
I remove the dump in Database.php
I didn't change the Database type. This is a PostgreSQL database from start.
Ah, okay. That's strange…
So the data is saved, but not shown correctly…
BTW on https://delurk.com/ I get the error SSL_ERROR_RX_RECORD_TOO_LONG.
In my test adding an attachments did not change the result. Is there any difference in the error of the server log?
SLL isn't still available.
Nothing more in logs since attachements are enabled. If I put it off and comment the attachement part in Database.php, the logs stay empty.
In another hand, if I use flat file storage system it works.
Did you create the tables manually (via description in INSTALL.md) or did you let PrivateBin create the tables for you? In PostgreSQL the attachment column needs to be TEXT and not BLOB or MEDIUMBLOB (see line 579 in Database.php). I suspect that otherwise, a stream instead of a string gets returned, as per PDOs LOB handling.
I create tables manually over INSTALL.md but I change BLOB to BYTEA because that was suggested in pgsql documentation https://www.postgresql.org/docs/9.1/static/datatype-binary.html
TEXT works great so thanks for all.
So is this issue solved or does someone think the doc or some code needs to be updated? (to clarify something or so?)
It's solved. You can add this in INSTALL.md :
In PostgreSQL the attachment column needs to be TEXT and not BLOB or MEDIUMBLOB