jtsternberg / DsgnWrks-Instagram-Importer

Backup your instagram photos & display your instagram archive. Supports importing to custom post-types & adding custom taxonomies.
http://wordpress.org/extend/plugins/dsgnwrks-instagram-importer/
33 stars 17 forks source link

Importer "chokes" on Turkey emoji #27

Open chrisaldrich opened 7 years ago

chrisaldrich commented 7 years ago

I had recently posted the following to instagram: https://www.instagram.com/p/BM5dwNtDPnU/

When the importer came to suck in the data and import it into my WordPress install it resulted in the following error:

error

I tried uninstalling, reinstalling, and re-authenticating to see if that was the problem with no luck. I was about to give up the whole affair in utter despair (because DsgnWrks Instagram Importer is my absolutely favorite plugin in of all time and because I didn't want to use Instagram anymore if I couldn't "own" my own photos.)

In desperation, I manually "imported" the post/photo and between that and surprisingly seeing a newer post being imported properly this morning, I'm able to take a reasonable guess as to what the problem is! I also tested on another instagram account and found the same results which "confirms" the issue.

Apparently Instagram posts with the Turkey Emoji 🦃 (I'm using an Android phone ) don't work well with either the Importer or even WordPress itself. I suspect that WordPress is viewing the translated code for the Turkey emoji (see also: http://www.iemoji.com/view/emoji/1861/animals-nature/turkey) as malicious code and not allowing it to be imported into the database. When trying to use the turkey emoji in a Title field (and several others) to post the photo manually, WordPress will post properly, but it scrubs the emoji code out of the post completely.

Does anyone have any experience in properly sanitizing emoji code to prevent this type of error in the future? Has anyone noticed other emoji that cause problems? I somewhat often use them and haven't seen any issues with other emoji like this.

The quickest fix is potentially to scrub out any Turkey emoji codes in future posts prior to attempting import--particularly as WordPress doesn't seem to be able to handle it properly either.

chrisaldrich commented 7 years ago

Cross posted to WordPress for underlying support: https://wordpress.org/support/topic/wordpress-chokes-on-turkey-emoji-for-thanksgiving/

chrisaldrich commented 7 years ago

Cross reference: http://stackoverflow.com/questions/12807176/php-writing-a-simple-removeemoji-function

addedlovely commented 7 years ago

@chrisaldrich I can replicate this. Did you get anywhere with this?

Have replied in the wordpress.org forum.

Out of interest, I can replicate the issue on GoDaddy managed Wordpress hosting - wandering if you were hosted there also?

chrisaldrich commented 7 years ago

I ultimately edited the original instagram post to remove the emoji to get around it, but haven't dug further into the issue after Otto's post via wordpress support. I suspect that I need to update the encoding to my database to have it work, but haven't had time to tinker with it recently.

I've seen the problem via two other hosts which aren't GoDaddy managed, so I don't suspect that's the underlying problem.

jtsternberg commented 5 years ago

Are you still seeing this issue?