git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nieuws: ignore missing image/contents of new articles
[minimedit.git]
/
nieuws.inc.php
diff --git
a/nieuws.inc.php
b/nieuws.inc.php
index 438c282ec46ef311346592e5ab0a01af4fdc23da..54853158a6a18ea14514757469d470d9bb4c8f34 100644
(file)
--- a/
nieuws.inc.php
+++ b/
nieuws.inc.php
@@
-29,6
+29,7
@@
class ArchiveArticle
function file()
{
function file()
{
+ if (!file_exists($this->page)) return;
return fopen($this->page, 'r');
}
return fopen($this->page, 'r');
}
@@
-54,7
+55,7
@@
class ArchiveArticle
function dateparts()
{
function dateparts()
{
- preg_match('</(\d{4})
/
(\d{2})-(\d{2})->', $this->page, $ymd);
+ preg_match('</(\d{4})
[/-]
(\d{2})-(\d{2})->', $this->page, $ymd);
return $ymd;
}
return $ymd;
}
@@
-96,7
+97,7
@@
class ArchiveArticle
function thumb($size = '300x')
{
if (!$this->image or $this->image[0] !== '/') return;
function thumb($size = '300x')
{
if (!$this->image or $this->image[0] !== '/') return;
- return
"thumb/$size{$this->image}"
;
+ return
preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image)
;
}
}
}
}