TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 13, 2024, 08:16:31 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 102
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 99
  • Total: 100
  • @rjen

Pasting HTML Article

Started by Lesmond, July 25, 2020, 07:32:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lesmond

Not sure if this is an error, If I copy/paste some text with smiles in it throws errors.

here is a section of something I pasted..
QuoteCan anyone remember those home Chemistry sets we could buy that contained lots of useful (and dangerous) stuff to experiment with ?😎

Type of error: Database
Database Error: Incorrect string value: '\xF0\x9F\x98\x8E\xF0\x9F...' for column 'body' at row 1
https://xxxxx.pw/index.php?action=tpadmin
/home/lesmond/public_html/forum/Sources/TPortalAdmin.php (Line 3363)


I did try pasting has plain text, but still got the error above.

I ended up going through all the text to remove the smiles and no errors 

lurkalot


lurkalot

Error
Type of error: Database
Error message:
Database Error: Incorrect string value: '\xF0\x9F\x98\x8E</...' for column 'body' at row 1
File: /home/vol11_7/byethost7.com/b7_24299229/htdocs/testsite7/Sources/TPortalAdmin.php
Line: 3364
URL of page causing the error: http://lts4.byethost7.com/testsite7/index.php?action=tpadmin

Backtrace information
#0: smf_db_error()
Called from /home/vol11_7/byethost7.com/b7_24299229/htdocs/testsite7/Sources/Subs-Db-mysql.php on line 489
#1: smf_db_query()
Called from /home/vol11_7/byethost7.com/b7_24299229/htdocs/testsite7/Sources/TPortalAdmin.php on line 3364
#2: do_postchecks()
Called from /home/vol11_7/byethost7.com/b7_24299229/htdocs/testsite7/Sources/TPortalAdmin.php on line 94
#3: TPortalAdmin()
Called from unknown on line -1
#4: call_user_func()
Called from /home/vol11_7/byethost7.com/b7_24299229/htdocs/testsite7/index.php on line 173

tino

SMF 2.0?

That's an entity encoding error.

Lesmond

Quote from: tino on July 25, 2020, 08:46:59 PM
SMF 2.0?

That's an entity encoding error.

Sorry yes "SMF 2.1 RC2 TinyPortal 1.6.7"

lurkalot

Quote from: tino on July 25, 2020, 08:46:59 PM
SMF 2.0?

That's an entity encoding error.

I noticed if you try posting that same piece of text with the smiley in 1.6.7 running on 2.0.17 it strips the smiley out and saves fine, just without the smiley.

lurkalot

And although this topic title suggests this is an article issue the same error occurs if you past it in a html block. 

Lesmond

The item I posted in the article had this ....


You can imagine how long it took me to remove all the smiles :(

Lesmond

Quote from: lurkalot on July 25, 2020, 09:58:57 PM
And although this topic title suggests this is an article issue the same error occurs if you past it in a html block. 
Actually I tried with a BBC article too, same result.

lurkalot

Quote from: Lesmond on July 25, 2020, 10:00:34 PM
The item I posted in the article had this ....


You can imagine how long it took me to remove all the smiles :(

Where were you copying the text from Les?  Just wondering what generated those smiles

lurkalot

Quote my post or click to modify it, you'll see your smiley is showing while mine is just showing the code.  Hence why I'm wondering where those smileys came from.

Just testing this ?😎

And also this  8)

Lesmond

Quote from: lurkalot on July 25, 2020, 10:08:41 PM
Where were you copying the text from Les?  Just wondering what generated those smiles

Originally from facebook, I thought that may have been the problem, so I copied the text to notepad in plain text, the smiles were copied into notepad too.

But it seems that it happens even if you copy from here too, as your test confirmed.

lurkalot

Quote from: Lesmond on July 25, 2020, 10:27:18 PM
Quote from: lurkalot on July 25, 2020, 10:08:41 PM
Where were you copying the text from Les?  Just wondering what generated those smiles

Originally from facebook, I thought that may have been the problem, so I copied the text to notepad in plain text, the smiles were copied into notepad too.

But it seems that it happens even if you copy from here too, as your test confirmed.

Seems that TP doesn't like Emoji's 😲

tino

Quote from: tino on July 25, 2020, 08:46:59 PM
That's an entity encoding error.

mb_entity_encode and UTF-8 will probably fix it.

@rjen

Just to confirm: checked it with Tp 200 on SMF 2.0 and 2.1

On SMF 20 the text is parsed and saved (smiley is saved as multiple question marks?)

On SMF 21 the database error shows

So it is an issue that only occurs on SMF 2.1 with both TP 167 and 200
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Lesmond

Just to point out, using an emoji from the editor works OK with no error, but copying one from elsewhere or using one from chromes built in emojis will give the error.




So to reiterate, if you copied this  :) you would not get an error.

If you copied this 😒 from chrome you would.

lurkalot

Quote from: tino on July 25, 2020, 11:18:06 PM
Quote from: tino on July 25, 2020, 08:46:59 PM
That's an entity encoding error.

mb_entity_encode and UTF-8 will probably fix it.

Hopefully Tino, thank you.  Think they addressed this at SMF 2.0.16, then done the same to 2.1 around the same time. 

Curious about the UTF-8 thing though, isn't 2.1 installed as UTF-8 by default, or do you mean something else?