Add serialize() action

This commit is contained in:
Matthew Batchelder 2013-07-25 13:49:28 -04:00
parent 5245ac4ce4
commit 439a9b5e8a
2 changed files with 15 additions and 0 deletions

View File

@ -124,6 +124,20 @@ class ActionUrlencode extends AbstractAction
}
}
class ActionSerialize extends AbstractAction
{
public function setUp()
{
$this->setContainer( new TextareaContainer );
$this->setFormatter( new EchoFormatter );
}
public function decode()
{
return serialize( $this->value );
}
}
class ActionUnserialize extends AbstractAction
{
public function setUp()

View File

@ -38,6 +38,7 @@ if( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
<option value="QuotedPrintableEncode" <?php echo selected($action_str, 'QuotedPrintableEncode'); ?>>quoted_printable_encode()</option>
<option value="Urlencode" <?php echo selected($action_str, 'Urlencode'); ?>>urlencode()</option>
<option value="Urldecode" <?php echo selected($action_str, 'Urldecode'); ?>>urldecode()</option>
<option value="Serialize" <?php echo selected($action_str, 'Serialize'); ?>>serialize()</option>
<option value="Unserialize" <?php echo selected($action_str, 'Unserialize'); ?>>unserialize()</option>
<option value="Base64Decode" <?php echo selected($action_str, 'Base64Decode'); ?>>base64_decode()</option>
<option value="Base64Encode" <?php echo selected($action_str, 'Base64Encode'); ?>>base64_encode()</option>