Add PHP Deserialization.

This commit is contained in:
Jarmo van Lenthe 2017-11-12 21:37:29 -05:00
parent 2cd4256ece
commit 4be7f89fd8
4 changed files with 145 additions and 1 deletions

View file

@ -66,6 +66,7 @@ const Categories = [
"Encode text",
"Decode text",
"Swap endianness",
"PHP Deserialize",
]
},
{

View file

@ -35,6 +35,7 @@ import StrUtils from "../operations/StrUtils.js";
import Tidy from "../operations/Tidy.js";
import Unicode from "../operations/Unicode.js";
import URL_ from "../operations/URL.js";
import PhpSerialization from "../operations/PhpSerialization.js";
/**
@ -3845,6 +3846,19 @@ const OperationConfig = {
}
]
},
"PHP Deserialize": {
module: "Default",
description: "PHP Deserialize a given input.<br><br>This function does not support <code>object</code> tags.<br><br><u>Output valid JSON:</u> JSON doesn't support integers as keys, where as PHP serialization does. Enabling this will cast these integers to strings. This will also escape backslashes.",
inputType: "string",
outputType: "string",
args: [
{
name: "Output valid JSON",
type: "boolean",
value: PhpSerialization.OUTPUT_VALID_JSON
}
]
},
};

View file

@ -27,7 +27,7 @@ import StrUtils from "../../operations/StrUtils.js";
import Tidy from "../../operations/Tidy.js";
import Unicode from "../../operations/Unicode.js";
import UUID from "../../operations/UUID.js";
import PhpSerialization from "../../operations/PhpSerialization";
/**
* Default module.
@ -155,6 +155,7 @@ OpModules.Default = {
"Conditional Jump": FlowControl.runCondJump,
"Return": FlowControl.runReturn,
"Comment": FlowControl.runComment,
"PHP Deserialize": PhpSerialization.PhpDeserialize,
/*