Skip to content

Commit

Permalink
Update bugfix 3.7.3 to dev (#276)
Browse files Browse the repository at this point in the history
* 3.7.2 intl fix (#270)

* fix for issue 257

* (int) PHP_INT_MAX

#257

* 3.7.2

* upd 3.7.2 boot for intl (#271)

* fix for issue 257

* (int) PHP_INT_MAX

#257

* 3.7.2

* upd boot for intl

* upd boot for intl

* fix intl test (#272)

* fix for issue 257

* (int) PHP_INT_MAX

#257

* 3.7.2

* upd boot for intl

* upd boot for intl

* fix intl test

* fix flux rss (aggrégateur)

#269

* no-intl support

#274

* update readme

un peu spécifique sur certains détails

* add 3.7.3 tag in update process
  • Loading branch information
remrem committed Apr 28, 2017
1 parent 5b4fc49 commit 1a15160
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 53 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Expand Up @@ -8,6 +8,11 @@
# note : each note will be start with "note :"
# note : 1 note by subject

[3.7.3]
note : This update is about bug fix, no need to update if 3.7.1 already installed and ok
- add support for php without the PHP intl extension
- fix feed aggregator

[3.7.2]
note : This update is about bug fix, no need to update if 3.7.1 already installed and ok
note : A bug with the feed aggregator is known, we are working on it, new update will go live soon!
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -19,17 +19,17 @@ This is BlogoText, the lightweight SQLite Blog-Engine.
---

## Requirements
* PHP >5.5
* SQLite with PDO support (or MySQL with PDO Support)
* A CSS3 / HTML5 compatible Browser (Firefox, Chrome…)
* PHP > 5.5
* SQLite or MySQL with PDO support
* A CSS3 / HTML5 / ES6 compatible Browser, for the admin panel (Firefox, Chrome…)
* min 2 Mo disk space (more data = more space needed)

## Recommended PHP libraries
* GD (for comments icons / favicons);
* cURL (for RSS reader, links sharing, comments icons)
* LibXML (for RSS reader)
* GZip (for zip exporting function)
* Intl
* [Intl](http://php.net/manual/en/book.intl.php)

## Installation
* Download [the lastest release](https://github.com/BlogoText/blogotext/releases)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.7.2
3.7.3
42 changes: 21 additions & 21 deletions admin/feed.php
Expand Up @@ -199,29 +199,29 @@ function feed_list_html($selected = '')
*/
function send_rss_json($feeds)
{
$out = '<script>';
$out .= 'var rss_entries = { "list": [';
$count = count($feeds) - 1;
foreach ($feeds as $idx => $feed) {
// Note: json_encode adds « " » on the data, so we use encode() and not '"'.encode().'"'
$out .= '{'.
'"id": '.json_encode($feed['bt_id']).','.
'"date": '.json_encode(date_formate(date('YmdHis', $feed['bt_date']))).','.
'"time": '.json_encode(heure_formate(date('YmdHis', $feed['bt_date']))).','.
'"title": '.json_encode($feed['bt_title']).','.
'"link": '.json_encode($feed['bt_link']).','.
'"feed": '.json_encode($feed['bt_feed']).','.
'"sitename": '.json_encode($GLOBALS['liste_flux'][$feed['bt_feed']]['title']).','.
'"folder": '.json_encode($GLOBALS['liste_flux'][$feed['bt_feed']]['folder']).','.
'"content": '.json_encode($feed['bt_content']).','.
'"statut": '.$feed['bt_statut'].','.
'"fav": '.$feed['bt_bookmarked'].
'}'.(($count == $idx) ? '' : ',');
$to_json = array(
'list' => array(),
'count' => (count($feeds) - 1)
);

$clean = array();
foreach ($feeds as $feed) {
$to_json['list'][] = array(
'id' => $feed['bt_id'],
'date' => date_formate(date('YmdHis', $feed['bt_date'])),
'time' => heure_formate(date('YmdHis', $feed['bt_date'])),
'title' => $feed['bt_title'],
'link' => $feed['bt_feed'],
'feed' => $feed['bt_feed'],
'sitename' => $GLOBALS['liste_flux'][$feed['bt_feed']]['title'],
'folder' => $GLOBALS['liste_flux'][$feed['bt_feed']]['folder'],
'content' => $feed['bt_content'],
'statut' => $feed['bt_statut'],
'fav' => $feed['bt_bookmarked']
);
}
$out .= ']}';
$out .= '</script>';

return $out;
return '<script>var rss_entries = '. json_encode($to_json) .';</script>';
}


Expand Down
3 changes: 3 additions & 0 deletions admin/install.php
Expand Up @@ -90,6 +90,9 @@ function install_form_1_echo($errors = '')

echo '<form method="post" action="install.php">';
echo '<div id="install">';
if (PHP_INTL === false) {
echo '<p class="erreurs" style="color: #FFA726;">We recommend to use the INTL extension for PHP before installing BlogoText.</p>';
}
echo '<p>';
echo '<label for="langue">Choisissez votre langue / Choose your language: ';
echo '<select id="langue" name="langue">';
Expand Down
44 changes: 23 additions & 21 deletions admin/update/update-to-3.7.php
Expand Up @@ -109,7 +109,7 @@


// check version
if (BLOGOTEXT_VERSION != '3.7.0' && BLOGOTEXT_VERSION != '3.7.0-dev' && BLOGOTEXT_VERSION != '3.7.1' && BLOGOTEXT_VERSION != '3.7.2') {
if (BLOGOTEXT_VERSION != '3.7.0' && BLOGOTEXT_VERSION != '3.7.0-dev' && BLOGOTEXT_VERSION != '3.7.1' && BLOGOTEXT_VERSION != '3.7.2' && BLOGOTEXT_VERSION != '3.7.3') {
echo $html_head;
echo '
<div class="center">
Expand Down Expand Up @@ -154,28 +154,30 @@
// ask for proceed
if (!isset($_GET['proceed'])) {
echo $html_head;
if (!function_exists('idn_to_ascii') || defined('INTL_FAIL')) {
echo '
<div class="center">
<h3>:(</h3>
<p class="erreurs" style="color: #D40000;">BlogoText requires the PHP intl extension (installed and activated).</p>
</div>';
} else {
echo '
<div class="center">
<h3>Update BlogoText to 3.7 ?</h3>
<p style="margin:0.5em auto;max-width:400px;text-align:left;">Some recommendations</p>
<ul>';
if (PHP_INTL === false) {
echo '
<div class="center">
<h3>Update BlogoText to 3.7 ?</h3>
<p>We recommand to make a backup of your file and database before
proceeding the update.</p>
<p style="margin-bottom:0.5em">This update will check and update
if necessary : </p>
<ul>
<li>Create the new config\'s files based on the old one</li>
<li>Delete the old config\'s files</li>
<li>Update the database scheme</li>
</ul>
<p><a class="btn" href="?proceed">Ok !</a></p>
</div>';
<li style="color: #D40000;">We recommend to use the
INTL extension for PHP before updating BlogoText to the 3.7
version.</li>';
}
echo '
<li>We recommand to make a backup of your file and database before
proceeding the update.</li>
</ul>
<p style="margin:1em auto;max-width:400px;text-align:left;">This update will check and update
if necessary : </p>
<ul>
<li>Create the new config\'s files based on the old one</li>
<li>Delete the old config\'s files</li>
<li>Update the database scheme</li>
</ul>
<p><a class="btn" href="?proceed">Ok !</a></p>
</div>';
echo $html_foot;
exit();
}
Expand Down
22 changes: 16 additions & 6 deletions inc/boot.php
Expand Up @@ -122,11 +122,22 @@ function import_ini_file($file_path)
/**
* dirty fix/message for install BT >= 3.7 && < 3.7.2
*/
if (!function_exists('idn_to_ascii')) {
define('INTL_FAIL', true);
function idn_to_ascii()
define('PHP_INTL', function_exists('idn_to_ascii'));
if (!PHP_INTL) {
function idn_to_ascii($string)
{
die('Please install and enable the php intl extension.');
// œ => oe ; æ => ae
$sanitized = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
$sanitized = htmlentities($sanitized, ENT_QUOTES, 'UTF-8'); // é => &eacute;
$sanitized = preg_replace('#&(.)(acute|grave|circ|uml|cedil|tilde|ring|slash|caron);#', '$1', $sanitized); // &eacute => e
$sanitized = preg_replace('#&([a-z]{2})lig;#i', '$1', $sanitized);
$sanitized = preg_replace("/[^a-z0-9-_\.\~]/", '', $sanitized);
if (empty(preg_replace("/[^a-z0-9]/", '', $sanitized))) {
$sanitized = substr(md5($string), 0, 12);
} else if ($string != $sanitized) {
$sanitized .= '-'.substr(md5($string), 0, 6);
}
return $sanitized;
}
}

Expand Down Expand Up @@ -211,7 +222,6 @@ function secure_host_to_path($http_host)
return $path;
}


// Constants: folders
define('DIR_ADDONS', BT_ROOT.'addons/');
define('DIR_BACKUP', BT_ROOT.'bt_backup/');
Expand All @@ -236,7 +246,7 @@ function secure_host_to_path($http_host)
// Constants: general
define('BLOGOTEXT_NAME', 'BlogoText');
define('BLOGOTEXT_SITE', 'https://github.com/BlogoText/blogotext');
define('BLOGOTEXT_VERSION', '3.7.2');
define('BLOGOTEXT_VERSION', '3.7.3');
define('MINIMAL_PHP_REQUIRED_VERSION', '5.5');
define('BLOGOTEXT_UA', 'Mozilla/5.0 (Windows NT 10; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0');

Expand Down

0 comments on commit 1a15160

Please sign in to comment.