Subversion Repositories oidinfo_api

Compare Revisions

Regard whitespace Rev 4 → Rev 5

/trunk/oidinfo_api.inc.phps
3,7 → 3,7
/**
* OID-Info.com API by Daniel Marschall, ViaThinkSoft
* License terms: Apache 2.0
* Revision: 2019-07-16
* Revision: 2019-08-27
*/
 
error_reporting(E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED);
204,10 → 204,17
return $phone;
}
 
private static function strip_to_xhtml_light($str){
private static function strip_to_xhtml_light($str, $allow_strong_text=false) {
// <strong> is allowed in the XSD, but not <b>
$str = str_ireplace('<b>', '<strong>', $str);
$str = str_ireplace('</b>', '</strong>', $str);
 
if (!$allow_strong_text) {
// <strong> is only used for very important things like the word "deprecated". It should therefore not used for anything else
$str = str_ireplace('<strong>', '', $str);
$str = str_ireplace('</strong>', '', $str);
}
 
$str = preg_replace('@<\s*script.+<\s*/script.*>@isU', '', $str);
$str = preg_replace('@<\s*style.+<\s*/style.*>@isU', '', $str);
 
510,6 → 517,15
$elements['description'] = $this->correctDesc($elements['description'], $params, self::OIDINFO_CORRECT_DESC_DISALLOW_ENDING_DOT, true);
$elements['information'] = $this->correctDesc($elements['information'], $params, self::OIDINFO_CORRECT_DESC_ENFORCE_ENDING_DOT, true);
 
// Request by O.D. 26 August 2019
$elements['description'] = trim($elements['description']);
if (preg_match('@^[a-z]@', $elements['description'], $m)) {
if (($ending_dot_policy != self::OIDINFO_CORRECT_DESC_ENFORCE_ENDING_DOT) && (strpos($elements['description'], ' ') === false)) { // <-- added by DM
$elements['description'] = '"' . $elements['description'] . '"';
}
}
// End request by O.D. 26. August 2019
 
if ($params['auto_extract_name'] || $params['auto_extract_url']) {
if (!empty($elements['information'])) $elements['information'] .= '<br /><br />';
if ($params['auto_extract_name'] || $params['auto_extract_url']) {