File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -34,23 +34,20 @@ class TwitterOAuth
34
34
*/
35
35
public function __construct (array $ config )
36
36
{
37
- $ defs = array (
37
+ $ keys = array (
38
38
'consumer_key ' => '' ,
39
39
'consumer_secret ' => '' ,
40
40
'oauth_token ' => '' ,
41
- 'oauth_token_secret ' => '' ,
41
+ 'oauth_token_secret ' => ''
42
42
);
43
43
44
- $ filters = array (
45
- 'consumer_key ' => FILTER_SANITIZE_STRING ,
46
- 'consumer_secret ' => FILTER_SANITIZE_STRING ,
47
- 'oauth_token ' => FILTER_SANITIZE_STRING ,
48
- 'oauth_token_secret ' => FILTER_SANITIZE_STRING ,
49
- );
44
+ if (count (array_intersect_key ($ keys , $ config )) !== 4 ) {
45
+ throw new \Exception ('Missing parameters in configuration array ' );
46
+ }
50
47
51
- $ this ->config = filter_var_array ( array_merge ( $ defs , $ config), $ filters ) ;
48
+ $ this ->config = $ config ;
52
49
53
- unset($ defs , $ filters );
50
+ unset($ keys , $ config );
54
51
}
55
52
56
53
/**
You can’t perform that action at this time.
0 commit comments