Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:joomla/joomla-cms into com_users
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Aug 31, 2017
2 parents 50c2c4a + 6f62252 commit f34fa61
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 41 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_menus/controllers/menus.php
Expand Up @@ -92,7 +92,7 @@ public function delete()
// Remove the items.
if (!$model->delete($cids))
{
$this->setMessage($model->getError());
$this->setMessage($model->getError(), 'error');
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/models/category.php
Expand Up @@ -93,7 +93,7 @@ public function getItems()
// Convert the params field into an object, saving original in _params
for ($i = 0, $n = count($items); $i < $n; $i++)
{
$item = & $items[$i];
$item = &$items[$i];
if (!isset($this->_params))
{
$item->params = new Registry($item->params);
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/models/featured.php
Expand Up @@ -119,7 +119,7 @@ public function getItems()
// Convert the params field into an object, saving original in _params
for ($i = 0, $n = count($items); $i < $n; $i++)
{
$item = & $items[$i];
$item = &$items[$i];
if (!isset($this->_params))
{
$item->params = new Registry($item->params);
Expand Down
4 changes: 2 additions & 2 deletions components/com_content/views/category/tmpl/blog.php
Expand Up @@ -76,7 +76,7 @@
<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = & $item;
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
Expand All @@ -101,7 +101,7 @@
<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = & $item;
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
Expand Down
19 changes: 15 additions & 4 deletions libraries/joomla/session/handler/joomla.php
Expand Up @@ -42,11 +42,17 @@ class JSessionHandlerJoomla extends JSessionHandlerNative
*/
public function __construct($options = array())
{
// Disable transparent sid support
ini_set('session.use_trans_sid', '0');
if (!headers_sent())
{
// Disable transparent sid support
ini_set('session.use_trans_sid', '0');

// Only allow the session ID to come from cookies and nothing else.
ini_set('session.use_only_cookies', '1');
// Only allow the session ID to come from cookies and nothing else.
if ((int) ini_get('session.use_cookies') !== 1)
{
ini_set('session.use_only_cookies', 1);
}
}

// Set options
$this->setOptions($options);
Expand Down Expand Up @@ -116,6 +122,11 @@ public function clear()
*/
protected function setCookieParams()
{
if (headers_sent())
{
return;
}

$cookie = session_get_cookie_params();

if ($this->force_ssl)
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/session/handler/native.php
Expand Up @@ -143,7 +143,7 @@ public function setName($name)
*/
public function regenerate($destroy = false, $lifetime = null)
{
if (null !== $lifetime)
if (!headers_sent() && null !== $lifetime)
{
ini_set('session.cookie_lifetime', $lifetime);
}
Expand Down
16 changes: 11 additions & 5 deletions libraries/joomla/session/storage.php
Expand Up @@ -95,11 +95,17 @@ public static function getInstance($name = 'none', $options = array())
*/
public function register()
{
// Use this object as the session handler
session_set_save_handler(
array($this, 'open'), array($this, 'close'), array($this, 'read'), array($this, 'write'),
array($this, 'destroy'), array($this, 'gc')
);
if (!headers_sent())
{
session_set_save_handler(
array($this, 'open'),
array($this, 'close'),
array($this, 'read'),
array($this, 'write'),
array($this, 'destroy'),
array($this, 'gc')
);
}
}

/**
Expand Down
8 changes: 6 additions & 2 deletions libraries/joomla/session/storage/memcache.php
Expand Up @@ -63,8 +63,12 @@ public function register()
if (!empty($this->_servers) && isset($this->_servers[0]))
{
$serverConf = current($this->_servers);
ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}");
ini_set('session.save_handler', 'memcache');

if (!headers_sent())
{
ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}");
ini_set('session.save_handler', 'memcache');
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions libraries/joomla/session/storage/memcached.php
Expand Up @@ -63,8 +63,12 @@ public function register()
if (!empty($this->_servers) && isset($this->_servers[0]))
{
$serverConf = current($this->_servers);
ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}");
ini_set('session.save_handler', 'memcached');

if (!headers_sent())
{
ini_set('session.save_path', "{$serverConf['host']}:{$serverConf['port']}");
ini_set('session.save_handler', 'memcached');
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions libraries/joomla/session/storage/redis.php
Expand Up @@ -52,8 +52,11 @@ public function register()
{
if (!empty($this->_server) && isset($this->_server['host']) && isset($this->_server['port']))
{
ini_set('session.save_path', "{$this->_server['host']}:{$this->_server['port']}");
ini_set('session.save_handler', 'redis');
if (!headers_sent())
{
ini_set('session.save_path', "{$this->_server['host']}:{$this->_server['port']}");
ini_set('session.save_handler', 'redis');
}

// This is required if the configuration.php gzip is turned on
ini_set('zlib.output_compression', 'Off');
Expand Down
5 changes: 4 additions & 1 deletion libraries/joomla/session/storage/wincache.php
Expand Up @@ -44,7 +44,10 @@ public function __construct($options = array())
*/
public function register()
{
ini_set('session.save_handler', 'wincache');
if (!headers_sent())
{
ini_set('session.save_handler', 'wincache');
}
}

/**
Expand Down
5 changes: 4 additions & 1 deletion libraries/src/Session/Session.php
Expand Up @@ -937,7 +937,10 @@ protected function _setOptions(array $options)
}

// Sync the session maxlifetime
ini_set('session.gc_maxlifetime', $this->_expire);
if (!headers_sent())
{
ini_set('session.gc_maxlifetime', $this->_expire);
}

return true;
}
Expand Down
10 changes: 0 additions & 10 deletions media/jui/css/jquery.searchtools.css
Expand Up @@ -69,16 +69,6 @@ html[dir=rtl] .js-stools .chzn-container {
margin-right: 0;
}

/* Fix for IE8 */
@media all\0 {
.js-stools .js-stools-field-list,
.js-stools .js-stools-field-filter {
display: block;
width: 180px;
float:left;
}
}

/* Media queries */
@media (max-width: 480px) {
.js-stools-container-filters {
Expand Down
12 changes: 6 additions & 6 deletions media/system/js/fields/calendar.js
Expand Up @@ -582,7 +582,7 @@
var cell = null,
row = null,
cal = this,
hh = function (text, cs, navtype, node, styles, classes, dataAttr) {
hh = function (text, cs, navtype, node, styles, classes, attributes) {
node = node ? node : "td";
styles = styles ? styles : {};
cell = createElement(node, row);
Expand All @@ -594,8 +594,8 @@
for (var key in styles) {
cell.style[key] = styles[key];
}
for (var key in dataAttr) {
cell.setAttribute(key, dataAttr[key]);
for (var key in attributes) {
cell.setAttribute(key, attributes[key]);
}
if (navtype !== 0 && Math.abs(navtype) <= 2) {
cell.className += " nav";
Expand Down Expand Up @@ -784,7 +784,7 @@
row = createElement("div", this.wrapper);
row.className = "buttons-wrapper btn-group";

this._nav_save = hh(JoomlaCalLocale.save, '', 100, 'button', '', 'js-btn btn btn-clear', {"data-action": "clear"});
this._nav_save = hh(JoomlaCalLocale.save, '', 100, 'button', '', 'js-btn btn btn-clear', {"type": "button", "data-action": "clear"});

if (!this.inputField.hasAttribute('required')) {
var savea = row.querySelector('[data-action="clear"]');
Expand All @@ -804,7 +804,7 @@
}

if (this.params.showsTodayBtn) {
this._nav_now = hh(JoomlaCalLocale.today, '', 0, 'button', '', 'js-btn btn btn-today', {"data-action": "today"});
this._nav_now = hh(JoomlaCalLocale.today, '', 0, 'button', '', 'js-btn btn btn-today', {"type": "button", "data-action": "today"});

var todaya = this.wrapper.querySelector('[data-action="today"]');
todaya.addEventListener('click', function (e) {
Expand All @@ -816,7 +816,7 @@
});
}

this._nav_exit = hh(JoomlaCalLocale.exit, '', 999, 'button', '', 'js-btn btn btn-exit', {"data-action": "exit"});
this._nav_exit = hh(JoomlaCalLocale.exit, '', 999, 'button', '', 'js-btn btn btn-exit', {"type": "button", "data-action": "exit"});
var exita = this.wrapper.querySelector('[data-action="exit"]');
exita.addEventListener('click', function (e) {
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion media/system/js/fields/calendar.min.js

Large diffs are not rendered by default.

Expand Up @@ -10,6 +10,7 @@
use Joomla\Registry\Registry;

include_once __DIR__ . '/stubs/JOAuth1ClientInspector.php';
include_once __DIR__ . '/../session/handler/array.php';

/**
* Test class for JOAuth1Client.
Expand Down Expand Up @@ -199,8 +200,13 @@ public function testAuthenticate($token, $fail, $version)
}
TestReflection::setValue($input, 'data', $data);

$memoryHandler = new JSessionHandlerArray;

// Get mock session
$mockSession = $this->getMockBuilder('JSession')->setMethods(array( '_start', 'get'))->getMock();
$mockSession = $this->getMockBuilder('JSession')
->setMethods(array( '_start', 'get'))
->setConstructorArgs(array('none', array(), $memoryHandler))
->getMock();

if ($fail)
{
Expand Down

0 comments on commit f34fa61

Please sign in to comment.