Skip to content

Commit

Permalink
Yoda
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Sep 25, 2017
1 parent 57410d6 commit 10bab46
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 121 deletions.
4 changes: 2 additions & 2 deletions action.article.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@

$op = Request::getCmd('op', 'check', 'POST');//isset($_POST['op']) ? $_POST['op'] : '';

if ($op === 'del' || !empty(Request::getString('del', '', 'POST'))) {
if ('del' === $op || !empty(Request::getString('del', '', 'POST'))) {
$articleHandler->delete($article_obj);
$redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
$message = planet_constant('MD_SAVED');
redirect_header($redirect, 2, $message);
} elseif ($op === 'save') {
} elseif ('save' === $op) {
if (empty($_POST['art_content'])) {
redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_TEXTEMPTY'));
}
Expand Down
4 changes: 2 additions & 2 deletions action.blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
redirect_header('index.php', 2, _NOPERM);
}

if ($op === 'save' && !empty(Request::getString('fetch', '', 'POST'))) {//!empty($_POST['fetch'])) {
if ('save' === $op && !empty(Request::getString('fetch', '', 'POST'))) {//!empty($_POST['fetch'])) {
$op = 'edit';
}

if ($op === 'save' && !$GLOBALS['xoopsSecurity']->check()) {
if ('save' === $op && !$GLOBALS['xoopsSecurity']->check()) {
redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID') . ': security check failed');
}
include XOOPS_ROOT_PATH . '/header.php';
Expand Down
2 changes: 1 addition & 1 deletion admin/admin.blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
$blog_objs = $blogHandler->getByCategory($criteria);
} else {
/* All active blogs */
if ($category_id == 0) {
if (0 == $category_id) {
$criteria = new Criteria('1', 1);
$criteria->setStart($start);
$criteria->setLimit($xoopsModuleConfig['list_perpage']);
Expand Down
28 changes: 14 additions & 14 deletions class/class-IXR.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public function __construct($data, $type = false)
$type = $this->calculateType();
}
$this->type = $type;
if ($type === 'struct') {
if ('struct' === $type) {
/* Turn all the values in the array in to new IXR_Value objects */
foreach ($this->data as $key => $value) {
$this->data[$key] = new IXR_Value($value);
}
}
if ($type === 'array') {
if ('array' === $type) {
for ($i = 0, $j = count($this->data); $i < $j; ++$i) {
$this->data[$i] = new IXR_Value($this->data[$i]);
}
Expand All @@ -47,7 +47,7 @@ public function __construct($data, $type = false)
*/
public function calculateType()
{
if ($this->data === true || $this->data === false) {
if (true === $this->data || false === $this->data) {
return 'boolean';
}
if (is_int($this->data)) {
Expand Down Expand Up @@ -184,7 +184,7 @@ public function parse()
{
// first remove the XML declaration
$this->message = preg_replace('/<\?xml(.*)?\?' . '>/', '', $this->message);
if (trim($this->message) == '') {
if ('' == trim($this->message)) {
return false;
}
$this->_parser = xml_parser_create();
Expand All @@ -203,7 +203,7 @@ public function parse()
}
xml_parser_free($this->_parser);
// Grab the error messages, if any
if ($this->messageType === 'fault') {
if ('fault' === $this->messageType) {
$this->faultCode = $this->params[0]['faultCode'];
$this->faultString = $this->params[0]['faultString'];
}
Expand Down Expand Up @@ -278,7 +278,7 @@ public function tag_close($parser, $tag)
break;
case 'value':
// "If no type is indicated, the type is string."
if (trim($this->_currentTagContents) != '') {
if ('' != trim($this->_currentTagContents)) {
$value = (string)$this->_currentTagContents;
$this->_currentTagContents = '';
$valueFlag = true;
Expand Down Expand Up @@ -321,7 +321,7 @@ public function tag_close($parser, $tag)
*/
if (count($this->_arraystructs) > 0) {
// Add value to struct or array
if ($this->_arraystructstypes[count($this->_arraystructstypes) - 1] === 'struct') {
if ('struct' === $this->_arraystructstypes[count($this->_arraystructstypes) - 1]) {
// Add to struct
$this->_arraystructs[count($this->_arraystructs) - 1][$this->_currentStructName[count($this->_currentStructName) - 1]] = $value;
} else {
Expand Down Expand Up @@ -377,7 +377,7 @@ public function serve($data = false)
if (!$this->message->parse()) {
$this->error(-32700, 'parse error. not well formed');
}
if ($this->message->messageType !== 'methodCall') {
if ('methodCall' !== $this->message->messageType) {
$this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
}
$result = $this->call($this->message->methodName, $this->message->params);
Expand Down Expand Up @@ -417,12 +417,12 @@ public function call($methodname, $args)
}
$method = $this->callbacks[$methodname];
// Perform the callback and send the response
if (count($args) == 1) {
if (1 == count($args)) {
// If only one paramater just send that instead of the whole array
$args = $args[0];
}
// Are we dealing with a function or a method?
if (substr($method, 0, 5) === 'this:') {
if ('this:' === substr($method, 0, 5)) {
// It's a class method - check it exists
$method = substr($method, 5);
if (!method_exists($this, $method)) {
Expand Down Expand Up @@ -540,7 +540,7 @@ public function multiCall($methodcalls)
foreach ($methodcalls as $call) {
$method = $call['methodName'];
$params = $call['params'];
if ($method === 'system.multicall') {
if ('system.multicall' === $method) {
$result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden');
} else {
$result = $this->call($method, $params);
Expand Down Expand Up @@ -698,7 +698,7 @@ public function query()
}
$gotFirstLine = true;
}
if (trim($line) == '') {
if ('' == trim($line)) {
$gettingHeaders = false;
}
if (!$gettingHeaders) {
Expand All @@ -717,7 +717,7 @@ public function query()
return false;
}
// Is the message a fault?
if ($this->message->messageType === 'fault') {
if ('fault' === $this->message->messageType) {
$this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);

return false;
Expand Down Expand Up @@ -994,7 +994,7 @@ public function call($methodname, $args)
}
break;
case 'boolean':
if ($arg !== false && $arg !== true) {
if (false !== $arg && true !== $arg) {
$ok = false;
}
break;
Expand Down

0 comments on commit 10bab46

Please sign in to comment.