Changeset 1689:6a99bdc5ed01 for inc/core/class.dc.trackback.php
- Timestamp:
- 09/01/13 20:56:28 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/core/class.dc.trackback.php
r1684 r1689 147 147 //@} 148 148 149 private function pingAlreadyDone($post_id, $from_url) 150 { 151 $params = array( 152 'post_id' => $post_id, 153 'comment_site' => $from_url, 154 'comment_trackback' => 1, 155 ); 156 157 $rs = $this->core->blog->getComments($params, true); 158 if ($rs && !$rs->isEmpty()) { 159 return ($rs->f(0)); 160 } 161 162 return false; 163 } 164 149 165 private function addBacklink($post_id, $url, $blog_name, $title, $excerpt, &$comment) 150 166 { … … 206 222 $charset = ''; 207 223 $comment = ''; 208 224 209 225 $err = false; 210 226 $msg = ''; … … 238 254 $err = true; 239 255 $msg = 'Trackbacks are not allowed for this post or weblog.'; 256 } 257 258 $url = trim(html::clean($url)); 259 if ($this->pingAlreadyDone($post->post_id, $url)) { 260 $err = true; 261 $msg = 'The trackback has already been registered'; 240 262 } 241 263 } … … 270 292 $blog_name = html::escapeHTML($blog_name); 271 293 $blog_name = text::cutString($blog_name,60); 272 273 $url = trim(html::clean($url));274 294 275 295 try … … 361 381 } 362 382 383 if ($this->pingAlreadyDone($posts->post_id, $from_url)) { 384 throw new Exception(__('Don\'t repeat yourself, please.'), 48); 385 } 386 363 387 # OK. We've found our champion. Time to check the remote part. 364 388 try {
Note: See TracChangeset
for help on using the changeset viewer.