From 800523aef2f8e8f8958cecbef61fed67ab9fe9fa Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sun, 5 Apr 2015 00:26:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD?= =?UTF-8?q?=D0=B0=D0=BB=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=81=D0=BA=D0=B8=D0=BD=D0=B0=20=D0=B2=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D1=83=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D0=BD=D0=B8=D0=BA=D1=83,=20=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=20id=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app.php b/app.php index 8a9e8ab..841481e 100644 --- a/app.php +++ b/app.php @@ -70,16 +70,18 @@ $app->post('/system/setSkin', function() use ($app) { } $request = $app->request; + $nickname = mb_convert_case($request->getPost('nickname', 'string'), MB_CASE_LOWER, ENCODING); + $skin = Skins::findFirst(array(array( - 'userId' => (int) $request->getPost('userId', 'int') + 'nickname' => $nickname ))); if (!$skin) { $skin = new Skins(); - $skin->userId = (int) $request->getPost('userId', 'int'); + $skin->nickname = $nickname; } - $skin->nickname = mb_convert_case($request->getPost('nickname', 'string'), MB_CASE_LOWER, ENCODING); + $skin->userId = (int) $request->getPost('userId', 'int'); $skin->skinId = (int) $request->getPost('skinId', 'int'); $skin->hash = $request->getPost('hash', 'string'); $skin->is1_8 = (bool) $request->getPost('is1_8', 'int');