Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
469220b9
Commit
469220b9
authored
Nov 28, 2014
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add JSON polyfill
json_encode and json_decode functions for use in PHP 5.1
parent
048db12d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
qa-base.php
qa-include/qa-base.php
+20
-0
JSON.php
qa-include/vendor/JSON.php
+0
-0
qa-facebook-login-page.php
qa-plugin/facebook-login/qa-facebook-login-page.php
+0
-10
No files found.
qa-include/qa-base.php
View file @
469220b9
...
...
@@ -1602,6 +1602,26 @@
}
/**
* JSON compatibility layer for PHP 5.1
*/
if
(
!
function_exists
(
'json_encode'
)
&&
!
function_exists
(
'json_decode'
))
{
require_once
QA_INCLUDE_DIR
.
'vendor/JSON.php'
;
function
json_encode
(
$json
)
{
$service
=
new
Services_JSON
(
SERVICES_JSON_LOOSE_TYPE
);
return
$service
->
encode
(
$json
);
}
function
json_decode
(
$json
)
{
$service
=
new
Services_JSON
(
SERVICES_JSON_LOOSE_TYPE
);
return
$service
->
decode
(
$json
);
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
qa-
plugin/facebook-login
/JSON.php
→
qa-
include/vendor
/JSON.php
View file @
469220b9
File moved
qa-plugin/facebook-login/qa-facebook-login-page.php
View file @
469220b9
...
...
@@ -46,16 +46,6 @@
$tourl
=
qa_path_absolute
(
''
);
if
(
strlen
(
$app_id
)
&&
strlen
(
$app_secret
))
{
if
(
!
function_exists
(
'json_decode'
))
{
// work around fact that PHP might not have JSON extension installed
require_once
$this
->
directory
.
'JSON.php'
;
function
json_decode
(
$json
)
{
$decoder
=
new
Services_JSON
(
SERVICES_JSON_LOOSE_TYPE
);
return
$decoder
->
decode
(
$json
);
}
}
require_once
$this
->
directory
.
'facebook.php'
;
$facebook
=
new
Facebook
(
array
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment