diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/bookmarks/actions/bookmarks/save.php | 19 | ||||
-rw-r--r-- | mod/bookmarks/languages/en.php | 3 | ||||
-rw-r--r-- | mod/categories/deactivate.php | 6 | ||||
-rw-r--r-- | mod/file/actions/file/upload.php | 7 | ||||
-rw-r--r-- | mod/groups/start.php | 4 | ||||
-rw-r--r-- | mod/likes/views/default/annotation/likes.php | 2 | ||||
-rw-r--r-- | mod/messageboard/start.php | 2 | ||||
-rw-r--r-- | mod/messages/views/default/object/messages.php | 2 |
8 files changed, 35 insertions, 10 deletions
diff --git a/mod/bookmarks/actions/bookmarks/save.php b/mod/bookmarks/actions/bookmarks/save.php index 19bb3c73a..f240c4b26 100644 --- a/mod/bookmarks/actions/bookmarks/save.php +++ b/mod/bookmarks/actions/bookmarks/save.php @@ -24,7 +24,24 @@ if ($address && !preg_match("#^((ht|f)tps?:)?//#i", $address)) { $address = "http://$address"; } -if (!$title || !$address || !filter_var($address, FILTER_VALIDATE_URL)) { +if (!$title || !$address) { + register_error(elgg_echo('bookmarks:save:failed')); + forward(REFERER); +} + +// see https://bugs.php.net/bug.php?id=51192 +$php_5_2_13_and_below = version_compare(PHP_VERSION, '5.2.14', '<'); +$php_5_3_0_to_5_3_2 = version_compare(PHP_VERSION, '5.3.0', '>=') && + version_compare(PHP_VERSION, '5.3.3', '<'); + +$validated = false; +if ($php_5_2_13_and_below || $php_5_3_0_to_5_3_2) { + $tmp_address = str_replace("-", "", $address); + $validated = filter_var($tmp_address, FILTER_VALIDATE_URL); +} else { + $validated = filter_var($address, FILTER_VALIDATE_URL); +} +if (!$validated) { register_error(elgg_echo('bookmarks:save:failed')); forward(REFERER); } diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php index 1d32a0344..0478e292f 100644 --- a/mod/bookmarks/languages/en.php +++ b/mod/bookmarks/languages/en.php @@ -24,7 +24,7 @@ $english = array( 'bookmarks:with' => "Share with", 'bookmarks:new' => "A new bookmark", 'bookmarks:via' => "via bookmarks", - 'bookmarks:address' => "Address of the resource to bookmark", + 'bookmarks:address' => "Address of the bookmark", 'bookmarks:none' => 'No bookmarks', 'bookmarks:delete:confirm' => "Are you sure you want to delete this resource?", @@ -75,6 +75,7 @@ $english = array( */ 'bookmarks:save:failed' => "Your bookmark could not be saved. Make sure you've entered a title and address and then try again.", + 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could nto be saved.", 'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.", ); diff --git a/mod/categories/deactivate.php b/mod/categories/deactivate.php new file mode 100644 index 000000000..e15e2c6e9 --- /dev/null +++ b/mod/categories/deactivate.php @@ -0,0 +1,6 @@ +<?php +/** + * Remove admin notice to populate categories. + */ + +elgg_delete_admin_notice('categories_admin_notice_no_categories'); diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index 88a01745d..ee2889b4c 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -90,10 +90,11 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) { $filestorename = elgg_strtolower(time().$_FILES['upload']['name']); } - $file->setFilename($prefix.$filestorename); - $file->setMimeType($_FILES['upload']['type']); + $mime_type = $file->detectMimeType($_FILES['upload']['tmp_name'], $_FILES['upload']['type']); + $file->setFilename($prefix . $filestorename); + $file->setMimeType($mime_type); $file->originalfilename = $_FILES['upload']['name']; - $file->simpletype = file_get_simple_type($_FILES['upload']['type']); + $file->simpletype = file_get_simple_type($mime_type); // Open the file to guarantee the directory exists $file->open("write"); diff --git a/mod/groups/start.php b/mod/groups/start.php index 9e4694457..0425bdea6 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -435,7 +435,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "<span class=\"elgg-icon elgg-icon-delete\"></span>", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); @@ -447,7 +447,7 @@ function groups_annotation_menu_setup($hook, $type, $return, $params) { 'name' => 'edit', 'href' => "#edit-annotation-$annotation->id", 'text' => elgg_echo('edit'), - 'text_encode' => false, + 'encode_text' => false, 'rel' => 'toggle', ); $return[] = ElggMenuItem::factory($options); diff --git a/mod/likes/views/default/annotation/likes.php b/mod/likes/views/default/annotation/likes.php index e1ae20818..2dd01b6cd 100644 --- a/mod/likes/views/default/annotation/likes.php +++ b/mod/likes/views/default/annotation/likes.php @@ -31,7 +31,7 @@ if ($like->canEdit()) { 'href' => "action/likes/delete?annotation_id={$like->id}", 'text' => "<span class=\"elgg-icon elgg-icon-delete right\"></span>", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, + 'encode_text' => false, )); } diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php index 8a7f00958..0b0155069 100644 --- a/mod/messageboard/start.php +++ b/mod/messageboard/start.php @@ -150,7 +150,7 @@ function messageboard_annotation_menu_setup($hook, $type, $return, $params) { 'href' => $url, 'text' => "<span class=\"elgg-icon elgg-icon-delete\"></span>", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false + 'encode_text' => false ); $return[] = ElggMenuItem::factory($options); } diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php index b2d127d85..b6f9ed6d5 100644 --- a/mod/messages/views/default/object/messages.php +++ b/mod/messages/views/default/object/messages.php @@ -69,7 +69,7 @@ $delete_link = elgg_view("output/confirmlink", array( 'href' => "action/messages/delete?guid=" . $message->getGUID(), 'text' => "<span class=\"elgg-icon elgg-icon-delete right\"></span>", 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, + 'encode_text' => false, )); $body = <<<HTML |