Open GoogleCodeExporter opened 8 years ago
look in that line:
array_walk($http_code_required, function($value, $key) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
});
you need an update to php 5.3 or make changes in the lib.
Original comment by ottod...@googlemail.com
on 22 Mar 2012 at 2:53
While the code states that PHP 5+ is required, the use of the lambda function
in the array_walk call is PHP 5.3+ (AFAIK). It should suffice to replace that
call with something like
foreach ($http_code_required as $value) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
}
Original comment by joor.loo...@gmail.com
on 24 Mar 2012 at 2:35
foreach ($http_code_required as $value) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
}
Works like a charm.. Thanks joor.loo...
Saved me alot of time!!
Original comment by jeffrey....@gmail.com
on 31 Mar 2012 at 2:17
thanks for the php < 5.3 fix.
Original comment by oasis.fr...@gmail.com
on 7 Sep 2012 at 11:01
Thanks man...it's works for me...and saved a lot time of mine :)
Original comment by brijesh....@gmail.com
on 14 Sep 2012 at 4:53
Thanks man..it works fine..awesome :)
Original comment by JJai...@gmail.com
on 19 Jan 2013 at 10:50
With PHP Version 5.2.6, I just defined a function and inserted the call in the
array_walk function:
if(is_array($http_code_required)) {
function somefunction($value, $key) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
}
array_walk($http_code_required, somefunction($value, $key));
}
according to the official PHP documentation
(http://php.net/manual/en/function.array-walk.php):
bool array_walk ( array &$array , callable $funcname [, mixed $userdata = NULL
] )
the second parameter is the function name :)
Probably in PHP > 5.3 it's possible to define the function directly in the
array_walk..
Original comment by endriu.n...@gmail.com
on 13 Feb 2013 at 10:32
I have replace the function
foreach ($http_code_required as $value) {
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
}
the issue is gone away, but still i am unable to login by linked, while click
on linkedin button its doing nothing abut redirecting me on the same url with
"?lType=initiate" passed in my url..
please help me how can i solve this issue.
Original comment by tech.to...@gmail.com
on 3 May 2013 at 5:54
I did it this way: (This is line 257-267 in my linkedin_3.2.0.class.php now.)
// check passed data
if (!function_exists('ensureInt')) {
function ensureInt ($value, $key) { //original had this as an anonymous function in array_walk below.
if(!is_int($value)) {
throw new LinkedInException('LinkedIn->checkResponse(): $http_code_required must be an integer or an array of integer values');
}
}
}
if(is_array($http_code_required)) {
array_walk($http_code_required, 'ensureInt');
Original comment by TecB...@gmail.com
on 20 Dec 2013 at 1:46
Thanks a lot
Original comment by Deepanja...@gmail.com
on 25 Mar 2015 at 4:15
Original issue reported on code.google.com by
swai...@gmail.com
on 20 Mar 2012 at 5:36