Changeset 1674:00146501e490 for inc/core/class.dc.xmlrpc.php
- Timestamp:
- 09/01/13 03:16:29 (12 years ago)
- Branch:
- pingbacks
- Children:
- 1675:23613441b822, 1676:ae97601883d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.xmlrpc.php
r1179 r1674 214 214 array('array','integer','string','string'), 215 215 'Retrieve all of the comment statuses.'); 216 217 # Pingback support 218 $this->addCallback('pingback.ping',array($this,'pingback_ping'), 219 array('string', 'string', 'string'), 220 'Notify a link to a post.'); 216 221 } 217 222 … … 270 275 } 271 276 272 private function setBlog( )277 private function setBlog($bypass = false) 273 278 { 274 279 if (!$this->blog_id) { … … 288 293 } 289 294 290 if (!$this->core->blog->settings->system->enable_xmlrpc || 291 !$this->core->auth->check('usage,contentadmin',$this->core->blog->id)) { 295 if (!$bypass && 296 (!$this->core->blog->settings->system->enable_xmlrpc || 297 !$this->core->auth->check('usage,contentadmin',$this->core->blog->id))) { 292 298 $this->core->blog = null; 293 299 throw new Exception('Not enough permissions on this blog.'); … … 1629 1635 ); 1630 1636 } 1637 1638 /* Pingback support 1639 --------------------------------------------------- */ 1640 public function pingback_ping($from_url, $to_url) 1641 { 1642 # Come on, buddy! Don't make me waste time with this kind of silliness... 1643 if (!(filter_var($from_url, FILTER_VALIDATE_URL) && preg_match('!^https?://!',$from_url))) { 1644 throw new Exception(__('No valid source URL provided? Try again!'), 0); 1645 } 1646 1647 $this->setBlog(true); 1648 $tb = new dcTrackback($this->core); 1649 return $tb->receive_pb($from_url, $to_url); 1650 } 1631 1651 } 1632 1652 ?>
Note: See TracChangeset
for help on using the changeset viewer.