2013-10-08 84 views
0

即時通訊新的整個電子商務場景,但即時通訊試圖讓它在哪裏OpenCart將與ShipStation合作填寫發貨訂單和處理它們的付款。但是,即使在error_log中爲ShipStation擴展模塊發生此錯誤。由於時間問題導致自動導入的ShipStation問題?

更新: 什麼應該發生的時候,即時通訊應用程序ShipStation,並點擊從商店更新,它發送一個請求,這個export.php腳本(這就是我的錯誤)。

2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 

線15個狀態

$data['startdate'] = date('Y-m-d H:i:s', mktime($starttime[0], $starttime[1], 0, $startdate[0], $startdate[1], $startdate[2])); 

和線22個狀態

$data['enddate'] = date('Y-m-d H:i:s', mktime($endtime[0], $endtime[1], 0, $enddate[0], $enddate[1], $enddate[2])); 

赫雷什所有的代碼放在一起

if (isset($this->request->get['start_date'])) { 
     $start_date_time = explode(' ', $this->request->get['start_date']); 
     $startdate = explode('/', $start_date_time[0]); 
     $starttime = explode(':', $start_date_time[1]); 
     $data['startdate'] = date('Y-m-d H:i:s', mktime($starttime[0], $starttime[1], 0, $startdate[0], $startdate[1], $startdate[2])); 
    } 

    if (isset($this->request->get['end_date'])) { 
     $end_date_time = explode(' ', $this->request->get['end_date']); 
     $enddate = explode('/', $end_date_time[0]); 
     $endtime = explode(':', $end_date_time[1]); 
     $data['enddate'] = date('Y-m-d H:i:s', mktime($endtime[0], $endtime[1], 0, $enddate[0], $enddate[1], $enddate[2])); 

UPDATE的error_log

[08-Oct-2013 17:33:39 UTC] Array 
(
    [0] => 01%3a08 
) 

[08-Oct-2013 17:33:39 UTC] Array 
(
    [0] => 17%3a33 
) 

這是在raw_error_logs上,它匹配上面給出的數組。

162.209.46.39 - - [08/Oct/2013:13:33:39 -0400] "GET /shipstation/index.php?action=export&start_date=10%2f08%2f2013+01%3a08&end_date=10%2f08%2f2013+17%3a33&page=1&SS-UserName=R4ND0ML3TT3RSANDNUB3RS1T00K0UT&SS-Password=R4ND0ML3TT3RSANDNUB3RS1T00K0UT HTTP/1.1" 302 448 "-" "ShipStation" 
+0

你能告訴我們var_dump($ starttime);'''var_dump($ endtime')的輸出嗎?您在小時,每月,每分鐘和每天都使用相同的值,但必須是錯誤的。用'error_reporting(-1);'和'ini_set('display_errors',true);'開始開發。 –

+0

@Glavić'你對小時和月,分,日使用相同的值 - 我認爲你和你完全一樣,但事實是他正在使用'$ startdate'和'$ starttime'和'$ enddate'並且'$ endtime'變量... – shadyyx

+0

@shadyyx:lol,錯過了;)但是,當他轉儲這個變量時,他/我們會發現問題;) –

回答

1

通過GET鏈接,您已給出GET /shipstation/index.php?action=export&start_date=10%2f08%2f2013+01%3a08&...,不應發生通知。

start_dateend_date的格式與預期不同時,會發出通知。

替換代碼:

if (isset($this->request->get['start_date'])) { ... } 
if (isset($this->request->get['end_date'])) { ... } 

有:

foreach (array('start_date', 'end_date') as $field) { 
    if (!isset($this->request->get[$field])) continue; 
    $date = $this->request->get[$field]; 
    try { 
     $dt = new DateTime($date); 
     $data[str_replace('_', '', $field)] = $dt->format('Y-m-d H:i:s'); 
    } catch (Exception $e) { 
     exit("ERROR: Field '{$field}' has invalid datetime format = '{$date}' ({$e->getMessage()})"); 
    } 
} 

,看看是否發生錯誤。