use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Strings;
function hovercard_init(App $a)
{
'location' => $contact['location'],
'gender' => $contact['gender'],
'about' => $contact['about'],
- 'network' => format_network_name($contact['network'], $contact['url']),
+ 'network' => Strings::formatNetworkName($contact['network'], $contact['url']),
'tags' => $contact['keywords'],
'bd' => $contact['birthday'] <= '0001-01-01' ? '' : $contact['birthday'],
'account_type' => Contact::getAccountType($contact),
$profile['picdate'] = urlencode(defaults($profile, 'picdate', ''));
if (($profile['network'] != '') && ($profile['network'] != Protocol::DFRN)) {
- $profile['network_name'] = format_network_name($profile['network'], $profile['url']);
+ $profile['network_name'] = Strings::formatNetworkName($profile['network'], $profile['url']);
} else {
$profile['network_name'] = '';
}
$a->data['contact'] = $contact;
if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
- $networkname = format_network_name($contact['network'], $contact['url']);
+ $networkname = Strings::formatNetworkName($contact['network'], $contact['url']);
} else {
$networkname = '';
}
*
* @return string Formatted network name
*/
- public static function formatNetworkName($network, $url = 0) // format_network_name()
+ public static function formatNetworkName($network, $url = 0)
{
if ($network != "") {
if ($url != "") {
*/
public function testAutonameEven()
{
- $autoname1=autoname(10);
- $autoname2=autoname(10);
+ $autoname1= Friendica\Util\Strings::getRandomName(10);
+ $autoname2= Friendica\Util\Strings::getRandomName(10);
$this->assertNotEquals($autoname1, $autoname2);
}
*/
public function testAutonameOdd()
{
- $autoname1=autoname(9);
- $autoname2=autoname(9);
+ $autoname1= Friendica\Util\Strings::getRandomName(9);
+ $autoname2= Friendica\Util\Strings::getRandomName(9);
$this->assertNotEquals($autoname1, $autoname2);
}
*/
public function testAutonameNoLength()
{
- $autoname1=autoname(0);
+ $autoname1= Friendica\Util\Strings::getRandomName(0);
$this->assertEquals(0, strlen($autoname1));
}
*/
public function testAutonameNegativeLength()
{
- $autoname1=autoname(-23);
+ $autoname1= Friendica\Util\Strings::getRandomName(-23);
$this->assertEquals(0, strlen($autoname1));
}
*/
public function testAutonameLength1()
{
- $autoname1=autoname(1);
+ $autoname1= Friendica\Util\Strings::getRandomName(1);
$this->assertEquals(1, strlen($autoname1));
- $autoname2=autoname(1);
+ $autoname2= Friendica\Util\Strings::getRandomName(1);
$this->assertEquals(1, strlen($autoname2));
}