Skip to content

Commit

Permalink
MyBB 1.8.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dvz committed May 22, 2017
1 parent 0fb0cea commit 3308619
Show file tree
Hide file tree
Showing 10 changed files with 3,196 additions and 3,085 deletions.
4 changes: 2 additions & 2 deletions inc/class_core.php
Expand Up @@ -14,14 +14,14 @@ class MyBB {
*
* @var string
*/
public $version = "1.8.11";
public $version = "1.8.12";

/**
* The version code of MyBB we're running.
*
* @var integer
*/
public $version_code = 1811;
public $version_code = 1812;

/**
* The current working directory.
Expand Down
4 changes: 2 additions & 2 deletions inc/class_datacache.php
Expand Up @@ -1056,7 +1056,7 @@ function update_most_replied_threads()

$threads = array();

$query = $db->simple_select("threads", "tid, subject, replies, fid", "visible='1'", array('order_by' => 'replies', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));
$query = $db->simple_select("threads", "tid, subject, replies, fid, uid", "visible='1'", array('order_by' => 'replies', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));
while($thread = $db->fetch_array($query))
{
$threads[] = $thread;
Expand All @@ -1071,7 +1071,7 @@ function update_most_viewed_threads()

$threads = array();

$query = $db->simple_select("threads", "tid, subject, views, fid", "visible='1'", array('order_by' => 'views', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));
$query = $db->simple_select("threads", "tid, subject, views, fid, uid", "visible='1'", array('order_by' => 'views', 'order_dir' => 'DESC', 'limit_start' => 0, 'limit' => $mybb->settings['statslimit']));
while($thread = $db->fetch_array($query))
{
$threads[] = $thread;
Expand Down
39 changes: 39 additions & 0 deletions inc/functions.php
Expand Up @@ -8635,3 +8635,42 @@ function my_strip_tags($string, $allowable_tags = '')
$string = preg_replace($pattern, '', $string);
return strip_tags($string, $allowable_tags);
}

/**
* Escapes a RFC 4180-compliant CSV string.
* Based on https://github.com/Automattic/camptix/blob/f80725094440bf09861383b8f11e96c177c45789/camptix.php#L2867
*
* @param string $string The string to be escaped
* @param boolean $escape_active_content Whether or not to escape active content trigger characters
* @return string The escaped string
*/
function my_escape_csv($string, $escape_active_content=true)
{
if($escape_active_content)
{
$active_content_triggers = array('=', '+', '-', '@');
$delimiters = array(',', ';', ':', '|', '^', "\n", "\t", " ");

$first_character = mb_substr($string, 0, 1);

if(
in_array($first_character, $active_content_triggers, true) ||
in_array($first_character, $delimiters, true)
)
{
$string = "'".$string;
}

foreach($delimiters as $delimiter)
{
foreach($active_content_triggers as $trigger)
{
$string = str_replace($delimiter.$trigger, $delimiter."'".$trigger, $string);
}
}
}

$string = str_replace('"', '""', $string);

return $string;
}
2 changes: 1 addition & 1 deletion inc/languages/english.php
Expand Up @@ -15,7 +15,7 @@
$langinfo['website'] = "https://mybb.com/";

// Compatible version of MyBB
$langinfo['version'] = "1811";
$langinfo['version'] = "1812";

// Sets if the translation includes the Admin CP (1 = yes, 0 = no)
$langinfo['admin'] = 1;
Expand Down
23 changes: 23 additions & 0 deletions install/resources/upgrade40.php
@@ -0,0 +1,23 @@
<?php
/**
* MyBB 1.8
* Copyright 2014 MyBB Group, All Rights Reserved
*
* Website: http://www.mybb.com
* License: http://www.mybb.com/about/license
*
*/

/**
* Upgrade Script: 1.8.11
*/

$upgrade_detail = array(
"revert_all_templates" => 0,
"revert_all_themes" => 0,
"revert_all_settings" => 0
);

@set_time_limit(0);

/* Nothing to do for 1.8.11 */

0 comments on commit 3308619

Please sign in to comment.