Changeset 262
- Timestamp:
- 07/05/08 01:00:07 (5 months ago)
- Files:
-
- trunk/Phergie/Plugin/Url.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Url.php
r230 r262 167 167 $responses = array(); 168 168 foreach($matches as $m) { 169 $url = trim(rtrim($m[0], ' ), ].?!;'));170 171 // Check to see if the URL was from an email address, is a directory, e ct169 $url = trim(rtrim($m[0], ', ].?!;')); 170 171 // Check to see if the URL was from an email address, is a directory, etc 172 172 if (!empty($m[3])) { 173 173 $this->debug('Invalid Url: URL is either an email or a directory path. (' . $url . ')'); … … 176 176 177 177 // Parse the given URL 178 if (!$parsed = $this->parseU RL($url)) {178 if (!$parsed = $this->parseUrl($url)) { 179 179 $this->debug('Invalid Url: Could not parse the URL. (' . $url . ')'); 180 180 continue; … … 218 218 219 219 // Prevent spamfest 220 if ($this->checkU RLCache($url, $tinyUrl)) {220 if ($this->checkUrlCache($url, $tinyUrl)) { 221 221 $this->debug('Invalid Url: URL is in the cache. (' . $url . ')'); 222 222 continue; … … 305 305 306 306 // Update cache 307 $this->updateU RLCache($url, $tinyUrl);307 $this->updateUrlCache($url, $tinyUrl); 308 308 unset($title, $tinyUrl, $title); 309 309 } … … 344 344 * @return bool 345 345 */ 346 protected function checkU RLCache($url, $tiny)346 protected function checkUrlCache($url, $tiny) 347 347 { 348 348 $source = $this->event->getSource(); … … 352 352 * and minimize the size of the cache for less cache bloat. 353 353 */ 354 $url = $this->getU RLChecksum($url);355 $tiny = $this->getU RLChecksum($tiny);354 $url = $this->getUrlChecksum($url); 355 $tiny = $this->getUrlChecksum($tiny); 356 356 357 357 $cache = array( … … 382 382 * @return bool 383 383 */ 384 protected function updateU RLCache($url, $tiny)384 protected function updateUrlCache($url, $tiny) 385 385 { 386 386 $source = $this->event->getSource(); … … 390 390 * and minimize the size of the cache for less cache bloat. 391 391 */ 392 $url = $this->getU RLChecksum($url);393 $tiny = $this->getU RLChecksum($tiny);392 $url = $this->getUrlChecksum($url); 393 $tiny = $this->getUrlChecksum($tiny); 394 394 $time = time(); 395 395 … … 461 461 * and then return the hex checksum of the url. 462 462 */ 463 protected function getU RLChecksum($url)463 protected function getUrlChecksum($url) 464 464 { 465 465 $checksum = strtolower(urldecode($this->glueUrl($url, true))); … … 472 472 * or missing values. 473 473 */ 474 protected function parseU RL($url)474 protected function parseUrl($url) 475 475 { 476 476 if (is_array($url)) return $url; … … 509 509 $parsed = $uri; 510 510 if (!is_array($parsed)) { 511 $parsed = $this->parseU RL($parsed);511 $parsed = $this->parseUrl($parsed); 512 512 } 513 513