revert 01a2791e3a to avoid random preg internal errors. fix contact_template

This commit is contained in:
Fabio Comuni 2012-02-27 18:48:59 +01:00
parent a33031634e
commit 42d591d257
3 changed files with 9 additions and 7 deletions

View file

@ -160,7 +160,8 @@
krsort($this->nodes); krsort($this->nodes);
return $s; return $s;
} }
/*
private function _str_replace($str){ private function _str_replace($str){
#$this->search,$this->replace, #$this->search,$this->replace,
$searchs = $this->search; $searchs = $this->search;
@ -183,7 +184,7 @@
} }
return str_replace($this->search,$this->replace, $str); return str_replace($this->search,$this->replace, $str);
} }*/
public function replace($s, $r) { public function replace($s, $r) {
@ -205,7 +206,8 @@
$os = ""; $count=0; $os = ""; $count=0;
while($os!=$s && $count<10){ while($os!=$s && $count<10){
$os=$s; $count++; $os=$s; $count++;
$s = $this->_str_replace($s); //$s = $this->_str_replace($s);
$s = str_replace($this->search, $this->replace, $s);
} }
return template_unescape($s); return template_unescape($s);
} }

View file

@ -504,8 +504,8 @@ function contacts_content(&$a) {
'name' => $rr['name'], 'name' => $rr['name'],
'username' => $rr['name'], 'username' => $rr['name'],
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'url' => $url, 'itemurl' => $rr['url'],
'item' => $rr, 'network' => network_to_name($rr['network']),
); );
} }

View file

@ -17,8 +17,8 @@
</div> </div>
<div class="contact-name" id="contact-entry-name-$contact.id" >$contact.name</div> <div class="contact-name" id="contact-entry-name-$contact.id" >$contact.name</div>
<div class="contact-details" id="contact-entry-url-$contact.id" >$contact.item.url</div> <div class="contact-details" id="contact-entry-url-$contact.id" >$contact.itemurl</div>
<div class="contact-details" id="contact-entry-network-$contact.id" >$contact.item.network|network_to_name</div> <div class="contact-details" id="contact-entry-network-$contact.id" >$contact.network</div>
</div> </div>