| 
                                                        @@ -18,12 +18,12 @@  discard block  | 
                                                    
                                                    
                                                         | 
                                                         | 
                                                         block discarded – undo  | 
                                                    
                                                                                                                                                                                                                    
                                                            | 
                                                                                                                                    18
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    18
                                                                                                                                                                                                 | 
                                                                     $this->post_data=$all_data;  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    19
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    19
                                                                                                                                                                                                 | 
                                                                     $judger=new JudgerModel();  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    20
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    20
                                                                                                                                                                                                 | 
                                                                     $judger_list=$judger->list(8);  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    21
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        $this->judgerAccount = $judger_list[array_rand($judger_list)];  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    21
                                                                                                                                                                                                 | 
                                                            +        $this->judgerAccount=$judger_list[array_rand($judger_list)];  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    22
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    22
                                                                                                                                                                                                 | 
                                                                 }  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    23
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    23
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    24
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    24
                                                                                                                                                                                                 | 
                                                                 private function hduLogin()  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    25
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    25
                                                                                                                                                                                                 | 
                                                                 { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    26
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        $response=$this->grab_page('http://acm.hdu.edu.cn','hdu'); | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    26
                                                                                                                                                                                                 | 
                                                            +        $response=$this->grab_page('http://acm.hdu.edu.cn', 'hdu'); | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    27
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    27
                                                                                                                                                                                                 | 
                                                                     if (strpos($response, 'Sign In')!==false) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    28
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    28
                                                                                                                                                                                                 | 
                                                                         $params=[  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    29
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    29
                                                                                                                                                                                                 | 
                                                                             'username' => $this->judgerAccount["handle"],  | 
                                                        
                                                                                                                                                        
                                                         | 
                                                        @@ -44,7 +44,7 @@  discard block  | 
                                                    
                                                    
                                                         | 
                                                         | 
                                                         block discarded – undo  | 
                                                    
                                                                                                                                                                                                                    
                                                            | 
                                                                                                                                    44
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    44
                                                                                                                                                                                                 | 
                                                                     ];  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    45
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    45
                                                                                                                                                                                                 | 
                                                               | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    46
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    46
                                                                                                                                                                                                 | 
                                                                     $response=$this->post_data("http://acm.hdu.edu.cn/submit.php", http_build_query($params), "hdu", true, false); | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    47
                                                                                                                                                                                                 | 
                                                            
                                                                                                                             | 
                                                            -        $this->sub['jid'] = $this->judgerAccount['jid'];  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                             | 
                                                            
                                                                                                                                    47
                                                                                                                                                                                                 | 
                                                            +        $this->sub['jid']=$this->judgerAccount['jid'];  | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    48
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    48
                                                                                                                                                                                                 | 
                                                                     $res=Requests::get('http://acm.hdu.edu.cn/status.php?user='.$this->judgerAccount['handle'].'&pid='.$this->post_data['iid']); | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    49
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    49
                                                                                                                                                                                                 | 
                                                                     if (!preg_match("/<td height=22px>([\s\S]*?)<\/td>/", $res->body, $match)) { | 
                                                        
                                                                                                            
                                                            | 
                                                                                                                                    50
                                                                                                                                                                                                 | 
                                                            
                                                                                                                                    50
                                                                                                                                                                                                 | 
                                                                             $this->sub['verdict']='Submission Error';  | 
                                                        
                                                                                                                                                
                                         
                                        
                                            
                                                                                                    Please login to merge, or discard this patch.