Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few more updates #2540

Merged
merged 16 commits into from May 8, 2016
10 changes: 7 additions & 3 deletions emailpost.php
@@ -1,11 +1,15 @@
#!/usr/local/bin/php -q
#!/usr/bin/php -q
<?php

/**
* Handles the replying and posting of messages by email
*
* Note the shebang #!/usr/local/bin/php -q needs to point to the installed
* location of php, this is the typical location but yours may be different
* Note the shebang (#!) needs to point to the installed location of php on your
* system. If you have shell access running "which php" should return the correct
* path to use.
*
* For example
* - Ubuntu and Debian would normally be #!/usr/bin/php -q
*
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
Expand Down
10 changes: 7 additions & 3 deletions emailtopic.php
@@ -1,11 +1,15 @@
#!/usr/local/bin/php -q
#!/usr/bin/php -q
<?php

/**
* Handles the creating of new topics by email
*
* Note the shebang #!/usr/local/bin/php -q needs to point to the installed
* location of php, this is the typical location but yours may be different.
* Note the shebang (#!) needs to point to the installed location of php on your
* system. If you have shell access running "which php" should return the correct
* path to use.
*
* For example
* - Ubuntu and Debian would normally be #!/usr/bin/php -q
*
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
Expand Down
5 changes: 4 additions & 1 deletion sources/AbstractModel.php
Expand Up @@ -30,12 +30,13 @@ abstract class AbstractModel

/**
* The modSettings
* @var array
* @var object
*/
protected $_modSettings = array();

/**
* Make "global" items available to the class
*
* @param object|null $db
*/
public function __construct($db = null)
Expand All @@ -62,6 +63,8 @@ protected function _loadModsettings($name = '', $default = null)
return $this->_modSettings->{$name};
}
else
{
return $default;
}
}
}
2 changes: 1 addition & 1 deletion sources/Action.controller.php
Expand Up @@ -217,4 +217,4 @@ protected function _registerEvent($name, $method, $to_register)
$this->_events->register($name, array($name, array($class, $method, 0)));
}
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/AdminLog.controller.php
Expand Up @@ -249,4 +249,4 @@ public function settings_search()
{
return $this->_settings();
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/BadBehavior.controller.php
Expand Up @@ -202,7 +202,7 @@ protected function _setFilter()
/**
* Performs the removal of one or multiple log entries
*
* @param mixed[] $filter - an array describing the current filter
* @param array $filter - an array describing the current filter
*/
protected function _action_delete($filter)
{
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageCalendarModule.controller.php
Expand Up @@ -440,4 +440,4 @@ public function settings_search()
{
return $this->_settings();
}
}
}
20 changes: 12 additions & 8 deletions sources/admin/ManageFeatures.controller.php
Expand Up @@ -870,13 +870,17 @@ public function action_profile()

switch ((int) $rowData['placement'])
{
case 0: $placement .= 'standard';
break;
case 1: $placement .= 'withicons';
case 0:
$placement .= 'standard';
break;
case 2: $placement .= 'abovesignature';
case 1:
$placement .= 'withicons';
break;
case 3: $placement .= 'aboveicons';
case 2:
$placement .= 'abovesignature';
break;
case 3:
$placement .= 'aboveicons';
break;
}

Expand Down Expand Up @@ -1030,7 +1034,6 @@ public function action_profileedit()
$this->_req->post->field_name = $this->_req->getPost('field_name', 'Util::htmlspecialchars');
$this->_req->post->field_desc = $this->_req->getPost('field_desc', 'Util::htmlspecialchars');


$rows = isset($this->_req->post->rows) ? (int) $this->_req->post->rows : 4;
$cols = isset($this->_req->post->cols) ? (int) $this->_req->post->cols : 30;

Expand Down Expand Up @@ -1064,7 +1067,7 @@ public function action_profileedit()
{
case 'check':
$default = isset($this->_req->post->default_check) ? 1 : '';
break;
break;
case 'select':
case 'radio':
if (!empty($this->_req->post->select_option))
Expand Down Expand Up @@ -1096,7 +1099,8 @@ public function action_profileedit()
$field_options = substr($field_options, 0, -1);
}
break;
default: $default = isset($this->_req->post->default_value) ? $this->_req->post->default_value : '';
default:
$default = isset($this->_req->post->default_value) ? $this->_req->post->default_value : '';
}

// Text area by default has dimensions
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/ManageMaillist.controller.php
Expand Up @@ -1907,4 +1907,4 @@ public function list_maillist_unapproved($start, $items_per_page, $sort = '', $i
{
return list_maillist_unapproved($id, $start, $items_per_page, $sort);
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageMembers.controller.php
Expand Up @@ -1334,4 +1334,4 @@ protected function _getGroups()

return $member_groups;
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageNews.controller.php
Expand Up @@ -960,4 +960,4 @@ public function settings_search()
{
return $this->_settings();
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManagePermissions.controller.php
Expand Up @@ -1141,4 +1141,4 @@ public function action_postmod()

createToken('admin-mppm');
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageSearch.controller.php
Expand Up @@ -679,4 +679,4 @@ private function loadSearchAPIs()

return $apis;
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageSecurity.controller.php
Expand Up @@ -571,4 +571,4 @@ public function bbSettings_search()
{
return $this->_bbSettings();
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageServer.controller.php
Expand Up @@ -738,4 +738,4 @@ public function balancingSettings_search()
{
return $this->_balancingSettings();
}
}
}
2 changes: 1 addition & 1 deletion sources/admin/ManageSmileys.controller.php
Expand Up @@ -1762,4 +1762,4 @@ protected function clearSmileyCache()
Cache::instance()->remove('parsing_smileys');
Cache::instance()->remove('posting_smileys');
}
}
}
31 changes: 17 additions & 14 deletions sources/admin/ManageThemes.controller.php
Expand Up @@ -104,7 +104,10 @@ public function action_index()
global $txt, $context;

if (isset($this->_req->query->api))
return $this->action_index_api();
{
$this->action_index_api();
return;
}

// Load the important language files...
loadLanguage('ManageThemes');
Expand All @@ -121,7 +124,7 @@ public function action_index()
'options' => array($this, 'action_options', 'permission' => 'admin_forum'),
'install' => array($this, 'action_install', 'permission' => 'admin_forum'),
'remove' => array($this, 'action_remove', 'permission' => 'admin_forum'),
'pick' => array($this, 'action_pick'), // @todo ugly having that in this controller
'pick' => array($this, 'action_pick'), // @todo ugly having that in this controller
'edit' => array($this, 'action_edit', 'permission' => 'admin_forum'),
'copy' => array($this, 'action_copy', 'permission' => 'admin_forum'),
'themelist' => array($this, 'action_themelist', 'permission' => 'admin_forum'),
Expand Down Expand Up @@ -201,17 +204,17 @@ public function action_index_api()
// Theme administration, removal, choice, or installation...
// Of all the actions we currently know only this
$subActions = array(
// 'admin' => 'action_admin',
// 'list' => 'action_list',
// 'reset' => 'action_options',
// 'options' => 'action_options',
// 'install' => 'action_install',
// 'admin' => 'action_admin',
// 'list' => 'action_list',
// 'reset' => 'action_options',
// 'options' => 'action_options',
// 'install' => 'action_install',
'remove' => 'action_remove_api',
// 'pick' => 'action_pick',
// 'edit' => 'action_edit',
// 'copy' => 'action_copy',
// 'themelist' => 'action_themelist',
// 'browse' => 'action_browse',
// 'pick' => 'action_pick',
// 'edit' => 'action_edit',
// 'copy' => 'action_copy',
// 'themelist' => 'action_themelist',
// 'browse' => 'action_browse',
);

// Follow the sa or just go to administration.
Expand Down Expand Up @@ -262,7 +265,7 @@ public function action_admin()
Errors::instance()->fatal_lang_error('themes_none_selectable', false);

if (!in_array($this->_req->post->options['theme_guests'], $this->_req->post->options['known_themes']))
Errors::instance()->fatal_lang_error('themes_default_selectable', false);
Errors::instance()->fatal_lang_error('themes_default_selectable', false);

// Commit the new settings.
updateSettings(array(
Expand Down Expand Up @@ -1612,7 +1615,7 @@ private function _action_edit_submit()
$is_css = substr($this->_req->post->filename, -4) == '.css';

// Check you up
if (checkSession('post', '', false) == '' && validateToken('admin-te-' . md5($selectedTheme . '-' . $this->_req->post->filename), 'post', false) == true)
if (checkSession('post', '', false) === '' && validateToken('admin-te-' . md5($selectedTheme . '-' . $this->_req->post->filename), 'post', false) === true)
{
// Consolidate the format in which we received the file contents
if (is_array($file))
Expand Down
2 changes: 1 addition & 1 deletion sources/admin/PackageServers.controller.php
Expand Up @@ -802,4 +802,4 @@ public function ftp_connect()
}
}
}
}
}
4 changes: 2 additions & 2 deletions sources/admin/Packages.controller.php
Expand Up @@ -29,7 +29,7 @@ class Packages_Controller extends Action_Controller
{
/**
* listing of files in a packages
* @var string[]|boolean
* @var array|boolean
*/
private $_extracted_files;

Expand Down Expand Up @@ -181,7 +181,7 @@ public function action_install()
redirectexit('action=admin;area=packages');

// What are we trying to do
$this->_filename = preg_replace('~[\.]+~', '.', $file);
$this->_filename = (string) preg_replace('~[\.]+~', '.', $file);
$this->_uninstalling = $this->_req->query->sa === 'uninstall';

// If we can't find the file, our install ends here
Expand Down