function DrupalAddFeedTestCase::urlToRSSLinkPattern
Create a pattern representing the RSS feed in the page.
2 calls to DrupalAddFeedTestCase::urlToRSSLinkPattern()
- DrupalAddFeedTestCase::testBasicFeedAddNoTitle in drupal-7.x/
modules/ simpletest/ tests/ common.test - Test drupal_add_feed() with paths, URLs, and titles.
- DrupalAddFeedTestCase::testBasicFeedAddNoTitle in drupal-7.x/
modules/ simpletest/ tests/ common.test - Test drupal_add_feed() with paths, URLs, and titles.
Archivo
- drupal-7.x/
modules/ simpletest/ tests/ common.test, line 2653 - Tests for common.inc functionality.
Class
- DrupalAddFeedTestCase
- Basic tests for drupal_add_feed().
Código
function urlToRSSLinkPattern($url, $title = '') {
// Escape any regular expression characters in the URL ('?' is the worst).
$url = preg_replace('/([+?.*])/', '[$0]', $url);
$generated_pattern = '%<link +rel="alternate" +type="application/rss.xml" +title="' . $title . '" +href="' . $url . '" */>%';
return $generated_pattern;
}