Revert PMC-602

This commit is contained in:
Julio Cesar Laura Avendaño
2019-06-11 10:14:02 -04:00
parent f427403835
commit cc51c76b12
8 changed files with 143 additions and 512 deletions

View File

@@ -485,33 +485,6 @@ function csrfToken()
return isset($_SESSION['USR_CSRF_TOKEN']) ? $_SESSION['USR_CSRF_TOKEN'] : '';
}
/**
* Check if a string is a valid HTML code
*
* @param string $string
*
* @return bool
*
* @see G::replaceDataField()
*/
function stringIsValidHtml($string)
{
// To validate we use the DOMDocument class
$doc = new DOMDocument('1.0', 'UTF-8');
// Clean previous errors
libxml_clear_errors();
// This line have to be silenced because if the string is not an HTML a Warning is displayed
@$doc->loadHTML($string);
// Get last error parsing the HTML
$libXmlError = libxml_get_last_error();
// If the attribute "textContent" is empty or exists libxml errors, is not a valid HTML
return $doc->textContent !== '' && empty($libXmlError);
}
// Methods deleted in PHP 7.x, added in this file in order to keep compatibility with old libraries included/used in ProcessMaker
if (!function_exists('set_magic_quotes_runtime')) {
function set_magic_quotes_runtime($value) {