Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

61 lines (49 sloc) 1.632 kb
<?php /*
ocPortal
Copyright (c) ocProducts, 2004-2012
See text/EN/licence.txt for full licencing information.
NOTE TO PROGRAMMERS:
Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
**** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****
*/
/**
* @license http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
* @copyright ocProducts Ltd
* @package core
*/
/**
* URL'ise specially encoded text-acceptance language strings.
*
* @param string The language string
* @param mixed The URL (either tempcode or string)
* @param string The title of the hyperlink
* @param boolean Whether to use a new window
* @return tempcode The encoded version
*/
function _urlise_lang($string,$url,$title,$new_window)
{
$a=strpos($string,'<{');
$b=strpos($string,'}>');
if (($a===false) || ($b===false) || ($b<$a)) return make_string_tempcode($string);
$section=substr($string,$a+2,$b-$a-2);
$prior=substr($string,0,$a);
$after=substr($string,$b+2);
if ($GLOBALS['XSS_DETECT'])
{
ocp_mark_as_escaped($section);
ocp_mark_as_escaped($prior);
ocp_mark_as_escaped($after);
}
if (is_string($url))
{
if ($url=='') return protect_from_escaping($section);
} else
{
if ($url->is_empty()) return protect_from_escaping($section);
}
$out=new ocp_tempcode();
$out->attach(protect_from_escaping($prior));
$out->attach(hyperlink($url,protect_from_escaping($section),$new_window,false,$title));
$out->attach(protect_from_escaping($after));
return $out;
}
Jump to Line
Something went wrong with that request. Please try again.