@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use Luracast\Restler\Restler; |
| 20 | 20 | use Luracast\Restler\RestException; |
| 21 | 21 | use Luracast\Restler\Defaults; |
| 22 | -use Luracast\Restler\Format\UploadFormat; |
|
| 23 | 22 | |
| 24 | 23 | require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 25 | 24 | |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | use Luracast\Restler\RestException; |
| 21 | -use Luracast\Restler\Format\UploadFormat; |
|
| 22 | 21 | |
| 23 | 22 | |
| 24 | 23 | require_once DOL_DOCUMENT_ROOT.'/main.inc.php'; |
@@ -358,20 +358,20 @@ |
||
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | switch(strlen($utf8)) { |
| 361 | - case 1: |
|
| 362 | - // this case should never be reached, because we are in ASCII range |
|
| 363 | - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 364 | - return $utf8; |
|
| 365 | - |
|
| 366 | - case 2: |
|
| 367 | - // return a UTF-16 character from a 2-byte UTF-8 char |
|
| 368 | - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 369 | - return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1}))); |
|
| 370 | - |
|
| 371 | - case 3: |
|
| 372 | - // return a UTF-16 character from a 3-byte UTF-8 char |
|
| 373 | - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 374 | - return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2}))); |
|
| 361 | + case 1: |
|
| 362 | + // this case should never be reached, because we are in ASCII range |
|
| 363 | + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 364 | + return $utf8; |
|
| 365 | + |
|
| 366 | + case 2: |
|
| 367 | + // return a UTF-16 character from a 2-byte UTF-8 char |
|
| 368 | + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 369 | + return chr(0x07 & (ord($utf8{0}) >> 2)) . chr((0xC0 & (ord($utf8{0}) << 6)) | (0x3F & ord($utf8{1}))); |
|
| 370 | + |
|
| 371 | + case 3: |
|
| 372 | + // return a UTF-16 character from a 3-byte UTF-8 char |
|
| 373 | + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 |
|
| 374 | + return chr((0xF0 & (ord($utf8{0}) << 4)) | (0x0F & (ord($utf8{1}) >> 2))) . chr((0xC0 & (ord($utf8{1}) << 6)) | (0x7F & ord($utf8{2}))); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | // ignoring UTF-32 for now, sorry |
@@ -3505,15 +3505,15 @@ |
||
| 3505 | 3505 | { |
| 3506 | 3506 | switch ($type) |
| 3507 | 3507 | { |
| 3508 | - case 0: |
|
| 3509 | - return $this->LibStatut($this->status,$mode,$type); |
|
| 3510 | - case 1: |
|
| 3511 | - return $this->LibStatut($this->status_buy,$mode,$type); |
|
| 3512 | - case 2: |
|
| 3513 | - return $this->LibStatut($this->status_batch,$mode,$type); |
|
| 3514 | - default: |
|
| 3515 | - //Simulate previous behavior but should return an error string |
|
| 3516 | - return $this->LibStatut($this->status_buy,$mode,$type); |
|
| 3508 | + case 0: |
|
| 3509 | + return $this->LibStatut($this->status,$mode,$type); |
|
| 3510 | + case 1: |
|
| 3511 | + return $this->LibStatut($this->status_buy,$mode,$type); |
|
| 3512 | + case 2: |
|
| 3513 | + return $this->LibStatut($this->status_batch,$mode,$type); |
|
| 3514 | + default: |
|
| 3515 | + //Simulate previous behavior but should return an error string |
|
| 3516 | + return $this->LibStatut($this->status_buy,$mode,$type); |
|
| 3517 | 3517 | } |
| 3518 | 3518 | } |
| 3519 | 3519 | |