/
home
/
desid573
/
public_html
/
family
/
pdd
/
app
/
Vendor
/
Services
/
Twilio
/
/home/desid573/public_html/family/pdd/app/Vendor/Services/Twilio
mkdir
upload
Name
Size
Mode
Actions
Auth/
-
0755
rm
Rest/
-
0755
rm
TaskRouter/
-
0755
rm
AccessToken.php
2997
0644
edit
dl
rm
AutoPagingIterator.php
2834
0644
edit
dl
rm
Capability.php
5409
0644
edit
dl
rm
HttpException.php
68
0644
edit
dl
rm
HttpStream.php
3015
0644
edit
dl
rm
InstanceResource.php
2796
0644
edit
dl
rm
IPMessagingInstanceResource.php
487
0644
edit
dl
rm
IPMessagingListResource.php
639
0644
edit
dl
rm
JWT.php
5275
0644
edit
dl
rm
ListResource.php
6227
0644
edit
dl
rm
LookupsInstanceResource.php
479
0644
edit
dl
rm
LookupsListResource.php
1275
0644
edit
dl
rm
MonitorInstanceResource.php
479
0644
edit
dl
rm
MonitorListResource.php
631
0644
edit
dl
rm
NextGenInstanceResource.php
690
0644
edit
dl
rm
NextGenListResource.php
1810
0644
edit
dl
rm
NumberType.php
1076
0644
edit
dl
rm
Page.php
1414
0644
edit
dl
rm
PartialApplicationHelper.php
1067
0644
edit
dl
rm
PricingInstanceResource.php
477
0644
edit
dl
rm
PricingListResource.php
395
0644
edit
dl
rm
RequestValidator.php
1714
0644
edit
dl
rm
Resource.php
3697
0644
edit
dl
rm
RestException.php
1092
0644
edit
dl
rm
SIPListResource.php
386
0644
edit
dl
rm
TaskRouterInstanceResource.php
725
0644
edit
dl
rm
TaskRouterListResource.php
878
0644
edit
dl
rm
TimeRangeResource.php
1146
0644
edit
dl
rm
TinyHttp.php
4582
0644
edit
dl
rm
TrunkingInstanceResource.php
481
0644
edit
dl
rm
TrunkingListResource.php
1160
0644
edit
dl
rm
Twiml.php
4373
0644
edit
dl
rm
UsageResource.php
661
0644
edit
dl
rm
WorkflowConfiguration.php
2539
0644
edit
dl
rm
Edit:
/home/desid573/public_html/family/pdd/app/Vendor/Services/Twilio/Twiml.php
(4373B)
<?php /** * Exception class for Services_Twilio_Twiml. */ class Services_Twilio_TwimlException extends Exception {} /** * Twiml response generator. * * Author: Neuman Vong <neuman at ashmoremusic dot com> * License: http://creativecommons.org/licenses/MIT/ MIT */ class Services_Twilio_Twiml { protected $element; /** * Constructs a Twiml response. * * :param SimpleXmlElement|array $arg: Can be any of * * - the element to wrap * - attributes to add to the element * - if null, initialize an empty element named 'Response' */ public function __construct($arg = null) { switch (true) { case $arg instanceof SimpleXmlElement: $this->element = $arg; break; case $arg === null: $this->element = new SimpleXmlElement('<Response/>'); break; case is_array($arg): $this->element = new SimpleXmlElement('<Response/>'); foreach ($arg as $name => $value) { $this->element->addAttribute($name, $value); } break; default: throw new Services_Twilio_TwimlException('Invalid argument'); } } /** * Converts method calls into Twiml verbs. * * A basic example: * * .. code-block:: php * * php> print $this->say('hello'); * <Say>hello</Say> * * An example with attributes: * * .. code-block:: php * * print $this->say('hello', array('voice' => 'woman')); * <Say voice="woman">hello</Say> * * You could even just pass in an attributes array, omitting the noun: * * .. code-block:: php * * print $this->gather(array('timeout' => '20')); * <Gather timeout="20"/> * * :param string $verb: The Twiml verb. * :param array $args: * - (noun string) * - (noun string, attributes array) * - (attributes array) * * :return: A SimpleXmlElement * :rtype: SimpleXmlElement */ public function __call($verb, array $args) { list($noun, $attrs) = $args + array('', array()); if (is_array($noun)) { list($attrs, $noun) = array($noun, ''); } /* addChild does not escape XML, while addAttribute does. This means if * you pass unescaped ampersands ("&") to addChild, you will generate * an error. * * Some inexperienced developers will pass in unescaped ampersands, and * we want to make their code work, by escaping the ampersands for them * before passing the string to addChild. (with htmlentities) * * However other people will know what to do, and their code * already escapes ampersands before passing them to addChild. We don't * want to break their existing code by turning their &'s into * &amp; * * We also want to use numeric entities, not named entities so that we * are fully compatible with XML * * The following lines accomplish the desired behavior. */ $decoded = html_entity_decode($noun, ENT_COMPAT, 'UTF-8'); $normalized = htmlspecialchars($decoded, ENT_COMPAT, 'UTF-8', false); $child = empty($noun) ? $this->element->addChild(ucfirst($verb)) : $this->element->addChild(ucfirst($verb), $normalized); foreach ($attrs as $name => $value) { /* Note that addAttribute escapes raw ampersands by default, so we * haven't touched its implementation. So this is the matrix for * addAttribute: * * & turns into & * & turns into &amp; */ if (is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $child->addAttribute($name, $value); } return new static($child); } /** * Returns the object as XML. * * :return: The response as an XML string * :rtype: string */ public function __toString() { $xml = $this->element->asXml(); return str_replace( '<?xml version="1.0"?>', '<?xml version="1.0" encoding="UTF-8"?>', $xml); } }
Save
cmd:
run