IpInfoDb - Uncaught TypeError: Argument 11 passed to Geocoder\Model\Address
まだ誰も着手していません。
- #1095 @rtmotiondev による — マージされずにクローズ
評価
調査の方向性
IP 1.143.27.182 を使って IpInfoDb の検索を再現し、timezone_name_from_abbr() 周辺のタイムゾーン変換を調査してください。DST によって検索結果が false を返す場合の動作を確認し、その結果として Address の構築に boolean が渡されなくなっていることを検証してください。
索引モデルが issue の本文から書いたものです。
説明
While testing IpInfoDb with IP 1.143.27.182 I got Uncaught TypeError: Argument 11 passed to Geocoder\Model\Address::__construct() must be of the type string or null, bool given
IpInfoDB response:
'statusCode' => string 'OK' (length=2)
'statusMessage' => string '' (length=0)
'ipAddress' => string '1.143.27.182' (length=12)
'countryCode' => string 'AU' (length=2)
'countryName' => string 'Australia' (length=9)
'regionName' => string 'Victoria' (length=8)
'cityName' => string 'Geelong' (length=7)
'zipCode' => string '3220' (length=4)
'latitude' => string '-38.1471' (length=8)
'longitude' => string '144.361' (length=7)
'timeZone' => string '+11:00' (length=6)
$timezone = timezone_name_from_abbr('', (int) substr($data['timeZone'], 0, strpos($data['timeZone'], ':')) * 3600, 0);
timezone_name_from_abbr('', 39600, 0) // Melbourne Australia is observing DST so this does not work
The proper fix is to handle DST time or at the very minimum handle the case of timezone returning false which breaks Geocoder\Model\Address.
- 主要言語
- PHP
- スター
- 4k
- フォーク
- 525
- 平均マージ
- 8分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
geocoder-php/Geocoder のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
geocoder-php/Geocoder#1272 ·
-
question
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
geocoder-php/Geocoder#1267 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
geocoder-php/Geocoder#1266 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 38/100
geocoder-php/Geocoder#1244 · コメント 2 件 · リアクション 2 件 ·
-
provider
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
geocoder-php/Geocoder#1243 ·
geocoder-php/Geocoder の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
-
Перевод устарел
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
-
[6.x]: "Cannot use object of type stdClass as array" loading Users index (regression of #19182) オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100