It seems that it starts deviating when the encoded text contains this:zM[VB[[P010\\\\ /*(... continues ...) */
zM[VB> </script>
else
{
$elementOutput = $outerTag;
}
case '$':
$tagName= substr($tagName, 1 + $tokenOffset);
if ($element= $this->modx->getObject('modChunk', array ('name' => $this->realname($tagName)), true)) {
$element->set('name', $tagName);
$element->setTag($outerTag);
$element->setCacheable($cacheable);
$elementOutput= $element->process($tagPropString);
}
else
{
$elementOutput = $outerTag;
}
<?php
/* File showSnippetCall.php (MODx snippet)
* Created on Dec 18, 2009
* Project shawn_wilkerson
* @package MODx Revolution Scripts
* @version 1
* @category snippet
* @author W. Shawn Wilkerson
* @link http://www.shawnwilkerson.com
* @copyright Copyright (c) 2009, W. Shawn Wilkerson. All rights reserved.
* @license
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*
************************************************
* Purpose: to translate a snippet call into plain text
*
* Requirements: user must supply snippet call
* if you want to show the snippet as being not cached, place the ss_notcached=1 before the ss_call
*
* Example:
* [[showSnippetCall?ss_notcached=`1`&ss_call=`Wayfinder?startId=`62`&level=`1`&titleOfLinks=`menutitle`&textOfLinks=`description`&rowTpl=`wfListChildOrSibs`&sortBy=`menutitle`&showSubDocCount=`true`&displayStart=`true`&startItemTpl=`wfStartItemWithHeaders``]]
*
* [[showSnippetCall?ss_call=`accessUserProfile`]]
*
*
* Dependencies: MODx Revolution 2.x +
*
*
* Variable lexicon:
* Via Snippet call:
* $ss_call (string) actual call of a MODx snippet without brackets
* $ss_notcached (bool) [1 | 0] show snippet call as notcached [[!
*
* Snippet internal vars:
* $snippet (object)
* $content (string) snippet call without backets
* $ssPhpPrep (string) cleans anything the document parser, apache, or php may interpret as code
************************************************/
if (!function_exists(ssPhpPrep)) {
function ssPhpPrep($value) {
/**
* To purposely alter anything remotely looking like source code
* to ModParser, apache, or php
*/
$value = (strpos($value, "<") !== false) ? htmlentities($value) : $value;
$value = htmlspecialchars($value);
$value = str_replace("<", "<", $value);
$value = str_replace(">", ">", $value);
$value = str_replace("[", "[", $value);
$value = str_replace("]", "]", $value);
$value = str_replace("{", "{", $value);
$value = str_replace("}", "}", $value);
return $value;
}
}
if (!empty ($ss_call)) {
$ss_notcached = (!empty($ss_notcached) && ($ss_notcached === "1")) ? '!' : '';
/**
* check for backticks anywhere in the call as MODx will strip the last one off
* We add it back if we find any available. We could have also counted the
* occurances of ` (backtick) and %2 to make sure we had an even number.
*/
$pos = strpos($ss_call, '`');
$ss_call .= ($pos !== false) ? '`' : '';
return ssPhpPrep('[[' . $ss_notcached . $ss_call . ']]');
}
?>