phpcs: Fix violations

This commit is contained in:
logmanoriginal 2018-11-05 12:55:58 +01:00
parent e295dc5a79
commit 392e3ff6c7
30 changed files with 76 additions and 76 deletions

View File

@ -8,7 +8,7 @@ class ABCTabsBridge extends BridgeAbstract {
public function collectData(){
$html = '';
$html = getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html')
$html = getSimpleHTMLDOM(static::URI . 'tablatures/nouveautes.html')
or returnClientError('No results for this query.');
$table = $html->find('table#myTable', 0)->children(1);

View File

@ -45,7 +45,7 @@ class AllocineFRBridge extends BridgeAbstract {
public function getName(){
if(!is_null($this->getInput('category'))) {
return self::NAME . ' : '
.array_search(
. array_search(
$this->getInput('category'),
self::PARAMETERS[$this->queriedContext]['category']['values']
);

View File

@ -52,7 +52,7 @@ class AmazonBridge extends BridgeAbstract {
public function getName(){
if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))) {
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
return 'Amazon.' . $this->getInput('tld') . ': ' . $this->getInput('q');
}
return parent::getName();
@ -60,8 +60,8 @@ class AmazonBridge extends BridgeAbstract {
public function collectData() {
$uri = 'https://www.amazon.'.$this->getInput('tld').'/';
$uri .= 's/?field-keywords='.urlencode($this->getInput('q')).'&sort='.$this->getInput('sort');
$uri = 'https://www.amazon.' . $this->getInput('tld') . '/';
$uri .= 's/?field-keywords=' . urlencode($this->getInput('q')) . '&sort=' . $this->getInput('sort');
$html = getSimpleHTMLDOM($uri)
or returnServerError('Could not request Amazon.');
@ -86,7 +86,7 @@ class AmazonBridge extends BridgeAbstract {
$price = $element->find('span.s-price', 0);
$price = ($price) ? $price->innertext : '';
$item['content'] = '<img src="'.$image->getAttribute('src').'" /><br />'.$price;
$item['content'] = '<img src="' . $image->getAttribute('src') . '" /><br />' . $price;
$this->items[] = $item;
}

View File

@ -140,7 +140,7 @@ class AnidexBridge extends BridgeAbstract {
if (strpos($link->href, '/torrent/') === 0 && !in_array($link->href, $results))
$results[] = $link->href;
if (empty($results) && empty($this->getInput('q')))
returnServerError('No results from Anidex: '.$search_url);
returnServerError('No results from Anidex: ' . $search_url);
//Process each item individually
foreach ($results as $element) {
@ -156,7 +156,7 @@ class AnidexBridge extends BridgeAbstract {
if ($torrent_id != 0 && ctype_digit($torrent_id)) {
//Retrieve data for this torrent ID
$item_uri = self::URI . 'torrent/'.$torrent_id;
$item_uri = self::URI . 'torrent/' . $torrent_id;
//Retrieve full description from torrent page
if ($item_html = getSimpleHTMLDOMCached($item_uri)) {

View File

@ -47,7 +47,7 @@ class AutoJMBridge extends BridgeAbstract {
$item = array();
$item['uri'] = $url;
$item['title'] = $serie;
$item['content'] = '<p><img style="vertical-align:middle ; padding: 10px" src="' . $image . '" />'. $serie . '</p>';
$item['content'] = '<p><img style="vertical-align:middle ; padding: 10px" src="' . $image . '" />' . $serie . '</p>';
$item['content'] .= '<ul><li>Disponibilité : ' . $dispo . '</li>';
$item['content'] .= '<li>Carburant : ' . $carburant . '</li>';
$item['content'] .= '<li>Transmission : ' . $transmission . '</li>';

View File

@ -52,9 +52,9 @@ class CNETBridge extends BridgeAbstract {
returnClientError('Invalid topic: ' . $topic);
// Retrieve webpage
$pageUrl = self::URI . (empty($topic) ? 'news/' : $topic.'/');
$pageUrl = self::URI . (empty($topic) ? 'news/' : $topic . '/');
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request CNET: '.$pageUrl);
or returnServerError('Could not request CNET: ' . $pageUrl);
// Process articles
foreach($html->find('div.assetBody, div.riverPost') as $element) {

View File

@ -1074,10 +1074,10 @@ class PepperBridgeAbstract extends BridgeAbstract {
$url = $this->i8n('bridge-uri')
. '/search/advanced?q='
. urlencode($q)
. '&hide_expired='. $hide_expired
. '&hide_local='. $hide_local
. '&priceFrom='. $priceFrom
. '&priceTo='. $priceTo
. '&hide_expired=' . $hide_expired
. '&hide_local=' . $hide_local
. '&priceFrom=' . $priceFrom
. '&priceTo=' . $priceTo
/* Some default parameters
* search_fields : Search in Titres & Descriptions & Codes
* sort_by : Sort the search by new deals
@ -1152,30 +1152,30 @@ class PepperBridgeAbstract extends BridgeAbstract {
foreach ($list as $deal) {
$item = array();
$item['uri'] = $deal->find('div[class=threadGrid-title]', 0)->find('a', 0)->href;
$item['title'] = $deal->find('a[class*='. $selectorLink .']', 0
$item['title'] = $deal->find('a[class*=' . $selectorLink . ']', 0
)->plaintext;
$item['author'] = $deal->find('span.thread-username', 0)->plaintext;
$item['content'] = '<table><tr><td><a href="'
. $deal->find(
'a[class*='. $selectorImageLink .']', 0)->href
'a[class*=' . $selectorImageLink . ']', 0)->href
. '"><img src="'
. $this->getImage($deal)
. '"/></td><td><h2><a href="'
. $deal->find('a[class*='. $selectorLink .']', 0)->href
. $deal->find('a[class*=' . $selectorLink . ']', 0)->href
. '">'
. $deal->find('a[class*='. $selectorLink .']', 0)->innertext
. $deal->find('a[class*=' . $selectorLink . ']', 0)->innertext
. '</a></h2>'
. $this->getPrice($deal)
. $this->getDiscount($deal)
. $this->getShipsFrom($deal)
. $this->getShippingCost($deal)
. $this->GetSource($deal)
. $deal->find('div[class*='. $selectorDescription .']', 0)->innertext
. $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext
. '</td><td>'
. $deal->find('div[class*='. $selectorHot .']', 0)
. $deal->find('div[class*=' . $selectorHot . ']', 0)
->find('span', 1)->outertext
. '</td></table>';
$dealDateDiv = $deal->find('div[class*='. $selectorDate .']', 0)
$dealDateDiv = $deal->find('div[class*=' . $selectorDate . ']', 0)
->find('span[class=hide--toW3]');
$itemDate = end($dealDateDiv)->plaintext;
// In case of a Local deal, there is no date, but we can use
@ -1214,7 +1214,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
{
if ($deal->find(
'span[class*=thread-price]', 0) != null) {
return '<div>'.$this->i8n('price') .' : '
return '<div>' . $this->i8n('price') . ' : '
. $deal->find(
'span[class*=thread-price]', 0
)->plaintext
@ -1233,11 +1233,11 @@ class PepperBridgeAbstract extends BridgeAbstract {
{
if ($deal->find('span[class*=cept-shipping-price]', 0) != null) {
if ($deal->find('span[class*=cept-shipping-price]', 0)->children(0) != null) {
return '<div>'. $this->i8n('shipping') .' : '
return '<div>' . $this->i8n('shipping') . ' : '
. $deal->find('span[class*=cept-shipping-price]', 0)->children(0)->innertext
. '</div>';
} else {
return '<div>'. $this->i8n('shipping') .' : '
return '<div>' . $this->i8n('shipping') . ' : '
. $deal->find('span[class*=cept-shipping-price]', 0)->innertext
. '</div>';
}
@ -1253,7 +1253,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
private function GetSource($deal)
{
if ($deal->find('a[class=text--color-greyShade]', 0) != null) {
return '<div>'. $this->i8n('origin') .' : '
return '<div>' . $this->i8n('origin') . ' : '
. $deal->find('a[class=text--color-greyShade]', 0)->outertext
. '</div>';
} else {
@ -1274,7 +1274,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
} else {
$discount = '';
}
return '<div>'. $this->i8n('discount') .' : <span style="text-decoration: line-through;">'
return '<div>' . $this->i8n('discount') . ' : <span style="text-decoration: line-through;">'
. $deal->find(
'span[class*=mute--text text--lineThrough]', 0
)->plaintext
@ -1315,13 +1315,13 @@ class PepperBridgeAbstract extends BridgeAbstract {
'cept-thread-img'
)
);
if ($deal->find('img[class='. $selectorLazy .']', 0) != null) {
if ($deal->find('img[class=' . $selectorLazy . ']', 0) != null) {
return json_decode(
html_entity_decode(
$deal->find('img[class='. $selectorLazy .']', 0)
$deal->find('img[class=' . $selectorLazy . ']', 0)
->getAttribute('data-lazy-img')))->{'src'};
} else {
return $deal->find('img[class*='. $selectorPlain .']', 0 )->src;
return $deal->find('img[class*=' . $selectorPlain . ']', 0 )->src;
}
}
@ -1340,9 +1340,9 @@ class PepperBridgeAbstract extends BridgeAbstract {
'text--color-greyShade'
)
);
if ($deal->find('span[class='. $selector .']', 0) != null) {
if ($deal->find('span[class=' . $selector . ']', 0) != null) {
return '<div>'
. $deal->find('span[class='. $selector .']', 0)->children(2)->plaintext
. $deal->find('span[class=' . $selector . ']', 0)->children(2)->plaintext
. '</div>';
} else {
return '';
@ -1445,12 +1445,12 @@ class PepperBridgeAbstract extends BridgeAbstract {
public function getName(){
switch($this->queriedContext) {
case $this->i8n('context-keyword'):
return $this->i8n('bridge-name') . ' - '. $this->i8n('title-keyword') .' : '. $this->getInput('q');
return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');
break;
case $this->i8n('context-group'):
$values = $this->getParameters()[$this->i8n('context-group')]['group']['values'];
$group = array_search($this->getInput('group'), $values);
return $this->i8n('bridge-name') . ' - '. $this->i8n('title-group'). ' : '. $group;
return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $group;
break;
default: // Return default value
return static::NAME;

View File

@ -81,7 +81,7 @@ class DiscogsBridge extends BridgeAbstract {
. $this->getInput('username_folder')
. '/collection/folders/'
. $this->getInput('folderid')
.'/releases?sort=added&sort_order=desc')
. '/releases?sort=added&sort_order=desc')
or returnServerError('Unable to query discogs !');
$jsonData = json_decode($data, true)['releases'];
}

View File

@ -99,7 +99,7 @@ class ETTVBridge extends BridgeAbstract {
public function collectData(){
// No control on inputs, because all defaultValue are set
$query_str = 'torrents-search.php';
$query_str .= '?search=' . urlencode('+'.str_replace(' ', ' +', $this->getInput('query')));
$query_str .= '?search=' . urlencode('+' . str_replace(' ', ' +', $this->getInput('query')));
$query_str .= '&cat=' . $this->getInput('cat');
$query_str .= '&incldead=' . $this->getInput('status');
$query_str .= '&lang=' . $this->getInput('lang');

View File

@ -167,7 +167,7 @@ EOD;
if($sectionContent != null) {
$sectionLink = $sectionContent->nextSibling();
if($sectionLink != null) {
$fullLink = '<a href="' . $sectionLink->getAttribute('href') . '">' . $sectionContent->innertext . '</a>';
$fullLink = '<a href="' . $sectionLink->getAttribute('href') . '">' . $sectionContent->innertext . '</a>';
$sectionContent->innertext = $fullLink;
}
}
@ -176,7 +176,7 @@ EOD;
foreach($content->find('section > a') as $sectionToFix) {
$sectionLink = $sectionToFix->getAttribute('href');
$section = $sectionToFix->parent();
$section->outertext = '<a href="' . $sectionLink . '">' . $section . '</a>';
$section->outertext = '<a href="' . $sectionLink . '">' . $section . '</a>';
}
$item['content'] = html_entity_decode($content, ENT_QUOTES);

View File

@ -49,9 +49,9 @@ class FDroidBridge extends BridgeAbstract {
$item['icon'] = $element->find('img', 0)->src;
$item['summary'] = $element->find('span.package-summary', 0)->plaintext;
$item['content'] = '
<a href="'.$item['uri'].'">
<img alt="" style="max-height:128px" src="'.$item['icon'].'">
</a><br>'.$item['summary'];
<a href="' . $item['uri'] . '">
<img alt="" style="max-height:128px" src="' . $item['icon'] . '">
</a><br>' . $item['summary'];
$this->items[] = $item;
}
}

View File

@ -69,7 +69,7 @@ class FourchanBridge extends BridgeAbstract {
. '" src="'
. $item['imageThumb']
. '" /></a><br>'
.$item['content'];
. $item['content'];
}
$this->items[] = $item;
}

View File

@ -35,7 +35,7 @@ class GBAtempBridge extends BridgeAbstract {
private function cleanupPostContent($content, $site_url){
$content = str_replace(':arrow:', '&#x27a4;', $content);
$content = str_replace('href="attachments/', 'href="'.$site_url.'attachments/', $content);
$content = str_replace('href="attachments/', 'href="' . $site_url . 'attachments/', $content);
$content = stripWithDelimiters($content, '<script', '</script>');
return $content;
}

View File

@ -28,7 +28,7 @@ class GoogleSearchBridge extends BridgeAbstract {
$html = getSimpleHTMLDOM(self::URI
. 'search?q='
. urlencode($this->getInput('q'))
.'&num=100&complete=0&tbs=qdr:y,sbd:1')
. '&num=100&complete=0&tbs=qdr:y,sbd:1')
or returnServerError('No results for this query.');
$emIsRes = $html->find('div[id=ires]', 0);

View File

@ -85,7 +85,7 @@ class InstagramBridge extends BridgeAbstract {
$item['content'] = $data[0];
$item['enclosures'] = $data[1];
} else {
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" alt="'. $item['title'] . '" />';
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" alt="' . $item['title'] . '" />';
$item['enclosures'] = array($media->display_url);
}
@ -108,12 +108,12 @@ class InstagramBridge extends BridgeAbstract {
}
$enclosures = [$mediaInfo->display_url];
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="'. $caption . '" />';
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="' . $caption . '" />';
foreach($mediaInfo->edge_sidecar_to_children->edges as $media) {
$display_url = $media->node->display_url;
if(!in_array($display_url, $enclosures)) { // add only if not added yet
$content .= '<img src="' . htmlentities($display_url) . '" alt="'. $caption . '" />';
$content .= '<img src="' . htmlentities($display_url) . '" alt="' . $caption . '" />';
$enclosures[] = $display_url;
}
}

View File

@ -9,7 +9,7 @@ class LWNprevBridge extends BridgeAbstract{
private $editionTimeStamp;
function getURI(){
return self::URI.'free/bigpage';
return self::URI . 'free/bigpage';
}
private function jumpToNextTag(&$node){
@ -47,7 +47,7 @@ class LWNprevBridge extends BridgeAbstract{
<html><head><title>LWN</title></head><body>{$content}</body></html>
EOD;
} else {
$content = $content.'</body></html>';
$content = $content . '</body></html>';
}
libxml_use_internal_errors(true);
@ -172,7 +172,7 @@ EOD;
$prefix = '';
if(!empty($cats[0])) {
$prefix .= '['.$cats[0].($cats[1] ? '/'.$cats[1] : '').'] ';
$prefix .= '[' . $cats[0] . ($cats[1] ? '/' . $cats[1] : '') . '] ';
}
return $prefix;
}
@ -188,7 +188,7 @@ EOD;
$item = array();
$item['uri'] = self::URI.'#'.count($items);
$item['uri'] = self::URI . '#' . count($items);
$item['timestamp'] = $this->editionTimeStamp;
@ -197,7 +197,7 @@ EOD;
$cat = $newsletters->previousSibling;
$this->jumpToPreviousTag($cat);
$prefix = $this->getItemPrefix($cat, $cats);
$item['title'] = $prefix.' '.$newsletters->textContent;
$item['title'] = $prefix . ' ' . $newsletters->textContent;
$node = $newsletters;
$content = '';
@ -233,7 +233,7 @@ EOD;
$cat = $cat->previousSibling;
$this->jumpToPreviousTag($cat);
$prefix = $this->getItemPrefix($cat, $cats);
$item['title'] = $prefix.' '.$title->textContent;
$item['title'] = $prefix . ' ' . $title->textContent;
$items[] = array_merge($item, $this->getArticleContent($title));
}
@ -255,7 +255,7 @@ EOD;
$cat = $cat->previousSibling;
$this->jumpToPreviousTag($cat);
$prefix = $this->getItemPrefix($cat, $cats);
$item['title'] = $prefix.' '.$title->textContent;
$item['title'] = $prefix . ' ' . $title->textContent;
$items[] = array_merge($item, $this->getArticleContent($title));
}

View File

@ -117,7 +117,7 @@ class NineGagBridge extends BridgeAbstract {
$cursor = 'c=10';
$posts = array();
for ($i = 0; $i < $this->getPages(); ++$i) {
$content = getContents($url.$cursor);
$content = getContents($url . $cursor);
$json = json_decode($content, true);
$posts = array_merge($posts, $json['data']['posts']);
$cursor = $json['data']['nextCursor'];
@ -156,7 +156,7 @@ class NineGagBridge extends BridgeAbstract {
$uri = $this->getInput('t');
}
return self::URI.$uri;
return self::URI . $uri;
}
protected function getGroup() {

View File

@ -75,7 +75,7 @@ class PikabuBridge extends BridgeAbstract {
continue;
}
}
$img->outertext = '<img src="'.$src.'">';
$img->outertext = '<img src="' . $src . '">';
}
$categories = array();

View File

@ -18,7 +18,7 @@ class PixivBridge extends BridgeAbstract {
public function collectData(){
$html = getContents(static::URI.'search.php?word=' . urlencode($this->getInput('tag')))
$html = getContents(static::URI . 'search.php?word=' . urlencode($this->getInput('tag')))
or returnClientError('Unable to query pixiv.net');
$regex = '/<input type="hidden"id="js-mount-point-search-result-list"data-items="([^"]*)/';
$timeRegex = '/img\/([0-9]{4})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\//';

View File

@ -58,7 +58,7 @@ class RTBFBridge extends BridgeAbstract {
public function getName(){
if(!is_null($this->getInput('c'))) {
return $this->getInput('c') .' - RTBF Bridge';
return $this->getInput('c') . ' - RTBF Bridge';
}
return parent::getName();

View File

@ -27,7 +27,7 @@ class RadioMelodieBridge extends BridgeAbstract {
$item['enclosures'] = array($pictureURL);
$item['uri'] = self::URI . $element->parent()->href;
$item['title'] = $element->find('h3', 0)->plaintext;
$item['content'] = $element->find('p', 0)->plaintext . '<br/><img src="'.$pictureURL.'"/>';
$item['content'] = $element->find('p', 0)->plaintext . '<br/><img src="' . $pictureURL . '"/>';
$this->items[] = $item;
}
}

View File

@ -25,7 +25,7 @@ class SuperSmashBlogBridge extends BridgeAbstract {
$video = $article['acf']['link_url'];
if (strlen($video) != 0) {
$video = str_get_html('<a href="' . $video .'">Youtube video</a>');
$video = str_get_html('<a href="' . $video . '">Youtube video</a>');
} else {
$video = '';
}

View File

@ -35,7 +35,7 @@ class TebeoBridge extends FeedExpander {
$item['uri'] = $element->find('a', 0)->href;
$item['title'] = $element->find('h3', 0)->plaintext;
$item['timestamp'] = strtotime($element->find('p.moment-format-day', 0)->plaintext);
$item['content'] = '<a href="'.$item['uri'].'"><img alt="" src="'.$element->find('img', 0)->src.'"></a>';
$item['content'] = '<a href="' . $item['uri'] . '"><img alt="" src="' . $element->find('img', 0)->src . '"></a>';
$this->items[] = $item;
}
}

View File

@ -25,12 +25,12 @@ class TheYeteeBridge extends BridgeAbstract {
$item['author'] = $author;
$uri = $element->find('div[class=controls] a', 0)->href;
$item['uri'] = static::URI.$uri;
$item['uri'] = static::URI . $uri;
$content = '<p>'.$element->find('section[class=product-listing-info] p', -1)->plaintext.'</p>';
$content = '<p>' . $element->find('section[class=product-listing-info] p', -1)->plaintext . '</p>';
$photos = $element->find('a[class=js-modaal-gallery] img');
foreach($photos as $photo) {
$content = $content."<br /><img src='$photo->src' />";
$content = $content . "<br /><img src='$photo->src' />";
$item['enclosures'][] = $photo->src;
}
$item['content'] = $content;

View File

@ -55,7 +55,7 @@ class UnsplashBridge extends BridgeAbstract {
$item['uri'] = str_replace(
array('q=75', 'w=400'),
array("q=$quality", "w=$width"),
$thumbnail->src).'.jpg'; // '.jpg' only for format hint
$thumbnail->src) . '.jpg'; // '.jpg' only for format hint
$item['timestamp'] = time();
$item['title'] = $thumbnail->alt;

View File

@ -377,7 +377,7 @@ class VkBridge extends BridgeAbstract
);
$post_videos[] = $video_id;
} else {
$content_suffix .= '<br>Video: <a href="'.htmlspecialchars($video_link).'">'.$video_title.'</a>';
$content_suffix .= '<br>Video: <a href="' . htmlspecialchars($video_link) . '">' . $video_title . '</a>';
}
}
@ -390,7 +390,7 @@ class VkBridge extends BridgeAbstract
if (isset($result['error'])) return;
foreach($result['response']['items'] as $item) {
$video_id = strval($item['owner_id']).'_'.strval($item['id']);
$video_id = strval($item['owner_id']) . '_' . strval($item['id']);
$this->videos[$video_id]['url'] = $item['player'];
}
@ -398,7 +398,7 @@ class VkBridge extends BridgeAbstract
foreach($item['videos'] as $video_id) {
$video_link = $this->videos[$video_id]['url'];
$video_title = $this->videos[$video_id]['title'];
$item['content'] .= '<br>Video: <a href="'.htmlspecialchars($video_link).'">'.$video_title.'</a>';
$item['content'] .= '<br>Video: <a href="' . htmlspecialchars($video_link) . '">' . $video_title . '</a>';
}
unset($item['videos']);
}
@ -408,6 +408,6 @@ class VkBridge extends BridgeAbstract
{
$params['v'] = '5.80';
$params['access_token'] = $this->getAccessToken();
return json_decode( getContents('https://api.vk.com/method/'.$method.'?'.http_build_query($params)), true );
return json_decode( getContents('https://api.vk.com/method/' . $method . '?' . http_build_query($params)), true );
}
}

View File

@ -43,7 +43,7 @@ class ZoneTelechargementBridge extends BridgeAbstract {
$hoster = $this->findLinkHoster($element);
// Format the link and add the link to the corresponding episode table
$episodes[$epnumber][] = '<a href="' . $element->href . '">'. $hoster . ' - '
$episodes[$epnumber][] = '<a href="' . $element->href . '">' . $hoster . ' - '
. $this->showTitle . ' Episode ' . $epnumber . '</a>';
}

View File

@ -21,7 +21,7 @@ class AtomFormat extends FormatAbstract{
if(!empty($extraInfos['icon'])) {
$icon = $extraInfos['icon'];
} else {
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] .'/favicon.ico');
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] . '/favicon.ico');
}
$uri = $this->xml_encode($uri);

View File

@ -22,7 +22,7 @@ class MrssFormat extends FormatAbstract {
}
$uriparts = parse_url($uri);
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] .'/favicon.ico');
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] . '/favicon.ico');
$items = '';
foreach($this->getItems() as $item) {
@ -56,7 +56,7 @@ Some media files might not be shown to you. Consider using the ATOM format inste
foreach($item['categories'] as $category) {
$entryCategories .= '<category>'
. $category . '</category>'
. $category . '</category>'
. PHP_EOL;
}
}

View File

@ -155,8 +155,8 @@ function markdownToHtml($string) {
$string = preg_replace('/_(.*)_/U', '<i>$1</i>', $string);
$string = preg_replace('/[-]{6,99}/', '<hr />', $string);
$string = str_replace('&#10;', '<br />', $string);
$string = preg_replace('/([^"])(https?:\/\/[^ "<]+)([^"])/', '$1<a href="$2">$2</a>$3', $string.' ');
$string = preg_replace('/([^"\/])(www\.[^ "<]+)([^"])/', '$1<a href="http://$2">$2</a>$3', $string.' ');
$string = preg_replace('/([^"])(https?:\/\/[^ "<]+)([^"])/', '$1<a href="$2">$2</a>$3', $string . ' ');
$string = preg_replace('/([^"\/])(www\.[^ "<]+)([^"])/', '$1<a href="http://$2">$2</a>$3', $string . ' ');
//As the regex are not perfect, we need to fix <i> and </i> that are introduced in URLs
// Fixup regex <i>: https://regex101.com/r/NTRPf6/1