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
3ea14aef
Commit
3ea14aef
authored
Jan 11, 2015
by
Gideon Greenspan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Placement of json ployfill in qa-base.php
parent
29cce8d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
qa-base.php
qa-include/qa-base.php
+19
-20
No files found.
qa-include/qa-base.php
View file @
3ea14aef
...
@@ -49,6 +49,25 @@
...
@@ -49,6 +49,25 @@
qa_initialize_php
();
qa_initialize_php
();
qa_initialize_constants_1
();
qa_initialize_constants_1
();
/**
* 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
();
return
$service
->
encode
(
$json
);
}
function
json_decode
(
$json
,
$assoc
=
false
)
{
$service
=
new
Services_JSON
(
$assoc
?
SERVICES_JSON_LOOSE_TYPE
:
0
);
return
$service
->
decode
(
$json
);
}
}
if
(
defined
(
'QA_WORDPRESS_LOAD_FILE'
))
// if relevant, load WordPress integration in global scope
if
(
defined
(
'QA_WORDPRESS_LOAD_FILE'
))
// if relevant, load WordPress integration in global scope
require_once
QA_WORDPRESS_LOAD_FILE
;
require_once
QA_WORDPRESS_LOAD_FILE
;
...
@@ -1619,26 +1638,6 @@
...
@@ -1619,26 +1638,6 @@
}
}
/**
* 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
();
return
$service
->
encode
(
$json
);
}
function
json_decode
(
$json
,
$assoc
=
false
)
{
$service
=
new
Services_JSON
(
$assoc
?
SERVICES_JSON_LOOSE_TYPE
:
0
);
return
$service
->
decode
(
$json
);
}
}
/*
/*
Omit PHP closing tag to help avoid accidental output
Omit PHP closing tag to help avoid accidental output
*/
*/
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