aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/classes/ElggMemcache.php6
-rw-r--r--engine/lib/database.php4
-rw-r--r--engine/lib/elgglib.php10
-rw-r--r--engine/lib/input.php6
-rw-r--r--engine/lib/views.php4
5 files changed, 19 insertions, 11 deletions
diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php
index f27b017d0..d9539b9cb 100644
--- a/engine/classes/ElggMemcache.php
+++ b/engine/classes/ElggMemcache.php
@@ -40,7 +40,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
// Do we have memcache?
if (!class_exists('Memcache')) {
- throw new ConfigurationException(elgg_echo('memcache:notinstalled'));
+ throw new ConfigurationException('PHP memcache module not installed, you must install php5-memcache');
}
// Create memcache object
@@ -48,7 +48,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
// Now add servers
if (!$CONFIG->memcache_servers) {
- throw new ConfigurationException(elgg_echo('memcache:noservers'));
+ throw new ConfigurationException('No memcache servers defined, please populate the $CONFIG->memcache_servers variable');
}
if (is_callable(array($this->memcache, 'addServer'))) {
@@ -85,7 +85,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
// Get version
$this->version = $this->memcache->getVersion();
if (version_compare($this->version, ElggMemcache::$MINSERVERVERSION, '<')) {
- $msg = elgg_echo('memcache:versiontoolow',
+ $msg = vsprintf('Memcache needs at least version %s to run, you are running %s',
array(ElggMemcache::$MINSERVERVERSION,
$this->version
));
diff --git a/engine/lib/database.php b/engine/lib/database.php
index cc2b99f6a..7d90b30b8 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -253,6 +253,10 @@ function execute_query($query, $dblink) {
throw new DatabaseException(elgg_echo('DatabaseException:InvalidQuery'));
}
+ if (!is_resource($dblink)) {
+ throw new DatabaseException(elgg_echo('DatabaseException:InvalidDBLink'));
+ }
+
$dbcalls++;
$result = mysql_query($query, $dblink);
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 62cb2d5bb..0c42c1c08 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1060,7 +1060,6 @@ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
switch ($errno) {
case E_USER_ERROR:
- case E_RECOVERABLE_ERROR: // (e.g. type hint violation)
error_log("PHP ERROR: $error");
register_error("ERROR: $error");
@@ -1070,6 +1069,7 @@ function _elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
case E_WARNING :
case E_USER_WARNING :
+ case E_RECOVERABLE_ERROR: // (e.g. type hint violation)
error_log("PHP WARNING: $error");
break;
@@ -1265,7 +1265,7 @@ function elgg_deprecated_notice($msg, $dep_version, $backtrace_level = 1) {
$msg .= implode("<br /> -> ", $stack);
- elgg_dump($msg, elgg_is_admin_logged_in(), 'WARNING');
+ elgg_log($msg, 'WARNING');
return true;
}
@@ -1578,7 +1578,11 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset
* @return void
* @since 1.8.0
*/
-function elgg_extract($key, array $array, $default = NULL, $strict = true) {
+function elgg_extract($key, array $array, $default = null, $strict = true) {
+ if (!is_array($array)) {
+ return $default;
+ }
+
if ($strict) {
return (isset($array[$key])) ? $array[$key] : $default;
} else {
diff --git a/engine/lib/input.php b/engine/lib/input.php
index dda8211b6..6d1646e1a 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -283,7 +283,7 @@ function input_livesearch_page_handler($page) {
WHERE e.guid = ue.guid
AND e.enabled = 'yes'
AND ue.banned = 'no'
- AND (ue.name LIKE '$q%' OR ue.username LIKE '$q%')
+ AND (ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')
LIMIT $limit
";
@@ -333,7 +333,7 @@ function input_livesearch_page_handler($page) {
WHERE e.guid = ge.guid
AND e.enabled = 'yes'
$owner_where
- AND (ge.name LIKE '$q%' OR ge.description LIKE '%$q%')
+ AND (ge.name LIKE '$q%' OR ge.name LIKE '% $q%' OR ge.description LIKE '% $q%')
LIMIT $limit
";
if ($entities = get_data($query)) {
@@ -379,7 +379,7 @@ function input_livesearch_page_handler($page) {
AND e.guid = ue.guid
AND e.enabled = 'yes'
AND ue.banned = 'no'
- AND (ue.name LIKE '$q%' OR ue.username LIKE '$q%')
+ AND (ue.name LIKE '$q%' OR ue.name LIKE '% $q%' OR ue.username LIKE '$q%')
LIMIT $limit
";
diff --git a/engine/lib/views.php b/engine/lib/views.php
index c98ad4e78..25acbf2b2 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1224,12 +1224,12 @@ function elgg_view_image_block($image, $body, $vars = array()) {
* @param string $type The type of module (main, info, popup, aside, etc.)
* @param string $title A title to put in the header
* @param string $body Content of the module
- * @param string $vars Additional parameters for the module
+ * @param array $vars Additional parameters for the module
*
* @return string
* @since 1.8.0
*/
-function elgg_view_module($type, $title, $body, $vars = array()) {
+function elgg_view_module($type, $title, $body, array $vars = array()) {
$vars['class'] = elgg_extract('class', $vars, '') . " elgg-module-$type";
$vars['title'] = $title;