Skip to content
TORNLIFE More

[BUG] API doesn't work with non-utf8 strings

Started by Stiny [992186] on in API Development.

6 replies · 81 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 7 / 7 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
7
Discussion span
→
People posting
3
Likes on archived posts
1
Posts by staff, officers and moderators
1
Authority score
72 / 100
Historical score
31 / 100
Story score
26 / 100
Engagement score
45 / 100

Most-liked replies

Stiny [992186]

Fatal error: Uncaught exception 'MongoException' with message 'non-utf8 string: Naughty Oil' in /torncity/html/casino/lib/sources/classes/MongoDB.php:45 Stack trace: #0 /torncity/html/casino/lib/sources/classes/MongoDB.php(45): MongoCollection->insert(Array, Array) #1 /torncity/html/casino/lib/sources/classes/MongoDB.php(122): MongoDBClass->insert('log_api_request...', Array, Array) #2 /torncity/html/casino/lib/sources/mongodb.lib.php(157): MongoDBClass->setNew('log_api_request...', Array, Array) #3 /torncity/html/casino/lib/DataSource.lib.php(201): _mongodb->set(Array, 'log_api_request...', '', '') #4 /torncity/html/casino/lib/CommonClasses/parentDBConnection.class.php(251): DataSource->set(Array, 'log_api_request...', '', '') #5 /torncity/html/casino/modules/api/classes/apiRequestLog.class.php(73): parentDBConnectionClass::set('mongodb', Array, 'log_api_request...', '') #6 /torncity/html/casino/modules/api/classes/apiRequestLog.class.php(36): apiRequestLogClass->saveLog(Array, 'log_api_request...') #7 /torncity/html/ca in /torncity/html/casino/lib/sources/classes/MongoDB.php on line 45


Returned from:http://api.torn.com/user/7105?selections=profile&key=
Meme_Raven [1891116]

Sorry, it's just hard to read without my glassses, try this at the very top:

<?php

header('Content-type: text/plain; charset=utf-8');