commit 25aa624928f0ade9f824785c92fa950637b576e8
parent 930570428b8ab888afb2e49421f665bad6bdf13a
Author: markseu <mark2011@mayberg.se>
Date: Wed, 7 Jun 2017 21:33:55 +0200
System update (spring remix)
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/system/plugins/webinterface.php b/system/plugins/webinterface.php
@@ -5,7 +5,7 @@
class YellowWebinterface
{
- const VERSION = "0.6.20";
+ const VERSION = "0.6.21";
var $yellow; //access to API
var $response; //web interface response
var $users; //web interface users
@@ -947,11 +947,12 @@ class YellowResponse
function getPageTitle($rawData)
{
$title = $this->yellow->page->get("title");
- if(preg_match("/^(\xEF\xBB\xBF)?\-\-\-[\r\n]+(.+?)[\r\n]+\-\-\-[\r\n]+/s", $rawData))
+ if(preg_match("/^(\xEF\xBB\xBF)?\-\-\-[\r\n]+(.+?)\-\-\-[\r\n]+/s", $rawData, $parts))
{
- foreach($this->yellow->toolbox->getTextLines($rawData) as $line)
+ foreach($this->yellow->toolbox->getTextLines($parts[2]) as $line)
{
- if(preg_match("/^(\s*Title\s*:\s*)(.*?)(\s*)$/i", $line, $matches)) { $title = $matches[2]; break; }
+ preg_match("/^\s*(.*?)\s*:\s*(.*?)\s*$/", $line, $matches);
+ if(lcfirst($matches[1])=="title" && !strempty($matches[2])) { $title = $matches[2]; break; }
}
}
return $title;
@@ -970,7 +971,8 @@ class YellowResponse
{
foreach($this->yellow->toolbox->getTextLines($rawData) as $line)
{
- if(preg_match("/^(\s*Title\s*:\s*)(.*?)(\s*)$/i", $line, $matches)) $line = $matches[1].$title.$matches[3];
+ preg_match("/^\s*(.*?)\s*:\s*(.*?)\s*$/", $line, $matches);
+ if(lcfirst($matches[1])=="title") $line = "Title: $title\n";
$rawDataNew .= $line;
}
return $rawDataNew;
@@ -1505,4 +1507,4 @@ class YellowMerge
}
$yellow->plugins->register("webinterface", "YellowWebinterface", YellowWebinterface::VERSION);
-?>
-\ No newline at end of file
+?>