File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -488,10 +488,10 @@ protected function getUserAccessToken() {
488488 */
489489 public function getSignedRequest () {
490490 if (!$ this ->signedRequest ) {
491- if (isset ($ _REQUEST ['signed_request ' ])) {
491+ if (! empty ($ _REQUEST ['signed_request ' ])) {
492492 $ this ->signedRequest = $ this ->parseSignedRequest (
493493 $ _REQUEST ['signed_request ' ]);
494- } else if (isset ($ _COOKIE [$ this ->getSignedRequestCookieName ()])) {
494+ } else if (! empty ($ _COOKIE [$ this ->getSignedRequestCookieName ()])) {
495495 $ this ->signedRequest = $ this ->parseSignedRequest (
496496 $ _COOKIE [$ this ->getSignedRequestCookieName ()]);
497497 }
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ private static function kNonTosedSignedRequest() {
4646 return $ facebook ->publicMakeSignedRequest (array ());
4747 }
4848
49+ private static function kSignedRequestWithEmptyValue () {
50+ return '' ;
51+ }
52+
4953 private static function kSignedRequestWithBogusSignature () {
5054 $ facebook = new FBPublic (array (
5155 'appId ' => self ::APP_ID ,
@@ -778,6 +782,18 @@ public function testNonTossedSignedtoken() {
778782 $ this ->assertTrue (isset ($ sr ['algorithm ' ]));
779783 }
780784
785+ public function testSignedRequestWithEmptyValue () {
786+ $ fb = new FBPublicCookie (array (
787+ 'appId ' => self ::APP_ID ,
788+ 'secret ' => self ::SECRET
789+ ));
790+ $ _REQUEST ['signed_request ' ] = self ::kSignedRequestWithEmptyValue ();
791+ $ this ->assertNull ($ fb ->getSignedRequest ());
792+ $ _COOKIE [$ fb ->publicGetSignedRequestCookieName ()] =
793+ self ::kSignedRequestWithEmptyValue ();
794+ $ this ->assertNull ($ fb ->getSignedRequest ());
795+ }
796+
781797 public function testSignedRequestWithWrongAlgo () {
782798 $ fb = new FBPublic (array (
783799 'appId ' => self ::APP_ID ,
You can’t perform that action at this time.
0 commit comments