Skip to content

Commit be4f22b

Browse files
committed
Moving api_unserialize_content for Unserialize::unserialize
Moving to avoid overload api.lib.php
1 parent 244b879 commit be4f22b

28 files changed

+32
-219
lines changed

main/admin/career_diagram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
$html = Display::page_subheader2($careerInfo['name'].$urlToString);
110110
if (!empty($item) && isset($item['value']) && !empty($item['value'])) {
111111
/** @var Graph $graph */
112-
$graph = api_unserialize_content('career', $item['value']);
112+
$graph = UnserializeApi::unserialize('career', $item['value']);
113113
$html .= Career::renderDiagramByColumn($graph, $tpl);
114114
} else {
115115
Display::addFlash(

main/admin/gradebook_list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188

189189
$options = [];
190190
if (!empty($categoryData['depends'])) {
191-
$list = api_unserialize_content('not_allowed_classes', $categoryData['depends']);
191+
$list = UnserializeApi::unserialize('not_allowed_classes', $categoryData['depends']);
192192
foreach ($list as $itemId) {
193193
$courseInfo = api_get_course_info_by_id($itemId);
194194
$options[$itemId] = $courseInfo['name'];

main/auth/sso/sso.Drupal.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function generateProfileEditingURL($userId = 0, $asAdmin = false)
293293
*/
294294
private function decode_cookie($cookie)
295295
{
296-
return api_unserialize_content(
296+
return UnserializeApi::unserialize(
297297
'not_allowed_classes',
298298
base64_decode($cookie)
299299
);

main/auth/sso/sso.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function generateProfileEditingURL($userId = 0, $asAdmin = false)
296296
*/
297297
private function decode_cookie($cookie)
298298
{
299-
return api_unserialize_content(
299+
return UnserializeApi::unserialize(
300300
'not_allowed_classes',
301301
base64_decode($cookie)
302302
);

main/course_home/course_home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394

395395
if (!empty($item) && isset($item['value']) && !empty($item['value'])) {
396396
/** @var Graph $graph */
397-
$graph = api_unserialize_content(
397+
$graph = UnserializeApi::unserialize(
398398
'career',
399399
$item['value']
400400
);

main/exercise/hotspot_admin.inc.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@
5656
$objAnswer = new Answer($questionId);
5757
}
5858

59-
$color = api_unserialize_content('not_allowed_classes', $color);
60-
$reponse = api_unserialize_content('not_allowed_classes', $reponse);
61-
$comment = api_unserialize_content('not_allowed_classes', $comment);
62-
$weighting = api_unserialize_content('not_allowed_classes', $weighting);
63-
$hotspot_coordinates = api_unserialize_content('not_allowed_classes', $hotspot_coordinates);
64-
$hotspot_type = api_unserialize_content('not_allowed_classes', $hotspot_type);
65-
$destination = api_unserialize_content('not_allowed_classes', $destination);
59+
$color = UnserializeApi::unserialize('not_allowed_classes', $color);
60+
$reponse = UnserializeApi::unserialize('not_allowed_classes', $reponse);
61+
$comment = UnserializeApi::unserialize('not_allowed_classes', $comment);
62+
$weighting = UnserializeApi::unserialize('not_allowed_classes', $weighting);
63+
$hotspot_coordinates = UnserializeApi::unserialize('not_allowed_classes', $hotspot_coordinates);
64+
$hotspot_type = UnserializeApi::unserialize('not_allowed_classes', $hotspot_type);
65+
$destination = UnserializeApi::unserialize('not_allowed_classes', $destination);
6666
unset($buttonBack);
6767
}
6868

main/exercise/question.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ public function search_engine_edit(
11451145
$se_doc = $di->get_document((int) $se_ref['search_did']);
11461146
if ($se_doc !== false) {
11471147
if (($se_doc_data = $di->get_document_data($se_doc)) !== false) {
1148-
$se_doc_data = api_unserialize_content(
1148+
$se_doc_data = UnserializeApi::unserialize(
11491149
'not_allowed_classes',
11501150
$se_doc_data
11511151
);

main/exercise/upload_exercise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ function lp_upload_quiz_action_handling()
549549

550550
if (!empty($lpObject)) {
551551
/** @var learnpath $oLP */
552-
$oLP = api_unserialize_content('lp', $lpObject);
552+
$oLP = UnserializeApi::unserialize('lp', $lpObject);
553553
if (is_object($oLP)) {
554554
if ((empty($oLP->cc)) || $oLP->cc != api_get_course_id()) {
555555
$oLP = null;

main/extra/upgrade_school_calendar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$sql4 = "UPDATE set_module SET cal_day_num = $d_number WHERE id = $d_id ";
3131
Database::query($sql4);
3232
print_r(
33-
api_unserialize_content(
33+
UnserializeApi::unserialize(
3434
'not_allowed_classes',
3535
Security::remove_XSS($_POST['aaa'])
3636
)

main/gradebook/lib/be/category.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function setCourseListDependency($value)
266266
{
267267
$this->courseDependency = [];
268268

269-
$unserialized = api_unserialize_content('not_allowed_classes', $value, true);
269+
$unserialized = UnserializeApi::unserialize('not_allowed_classes', $value, true);
270270

271271
if (false !== $unserialized) {
272272
$this->courseDependency = $unserialized;

0 commit comments

Comments
 (0)