Commit 617b94f4 authored by Jack'lul's avatar Jack'lul

Merge branch 'develop' into getupdates_without_db

parents 496bb6c2 a8fec933
dist: xenial
dist: trusty
sudo: required
language: php
......@@ -14,6 +14,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly
- hhvm
......@@ -42,7 +43,7 @@ before_script:
script:
- composer check-code
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ] ; then composer test-cov; else composer test; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ] ; then composer test-cov; else composer test; fi
after_script:
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then composer test-cov-upload; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.2" ]; then composer test-cov-upload; fi
......@@ -8,11 +8,13 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
- `Telegram::getLastUpdateId()` method, returns ID of the last update that was processed.
- `Telegram::useGetUpdatesWithoutDatabase()` method, enables `Telegram::handleGetUpdates()` to run without a database.
### Changed
- Updated Travis to use Trusty containers (for HHVM) and add PHP 7.2 to the tests.
- Add debug log entry instead of throwing an exception for duplicate updates.
- `Telegram::handleGetUpdates()` can now work without a database connection (not enabled by default).
### Deprecated
### Removed
### Fixed
- PHPCS fixes for updated CodeSniffer dependency.
### Security
## [0.52.0] - 2018-01-07
......
......@@ -22,12 +22,12 @@
"ext-pdo": "*",
"ext-curl": "*",
"ext-mbstring": "*",
"monolog/monolog": "^1.22",
"guzzlehttp/guzzle": "^6.2"
"monolog/monolog": "^1.23",
"guzzlehttp/guzzle": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.7|^6.1",
"squizlabs/php_codesniffer": "^2.8"
"phpunit/phpunit": "^4.8|^5.7|^6.5",
"squizlabs/php_codesniffer": "^3.2"
},
"autoload": {
"psr-4": {
......
This diff is collapsed.
......@@ -494,7 +494,8 @@ class Telegram
$this->getCommandsList();
//Make sure we don't try to process update that was already processed
if (count(DB::selectTelegramUpdate(1, $this->update->getUpdateId())) === 1) {
$last_id = DB::selectTelegramUpdate(1, $this->update->getUpdateId());
if ($last_id && count($last_id) === 1) {
TelegramLog::debug('Duplicate update received, processing aborted!');
return Request::emptyResponse();
}
......@@ -897,8 +898,7 @@ class Telegram
*/
protected function ucfirstUnicode($str, $encoding = 'UTF-8')
{
return
mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding)
return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding)
. mb_strtolower(mb_substr($str, 1, mb_strlen($str), $encoding), $encoding);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment