This commit is contained in:
Zarek Jenkinson 2013-06-13 23:47:47 +12:00
commit f2d0bc6cfa
8 changed files with 21 additions and 19 deletions

View File

@ -145,7 +145,7 @@ class SQLite extends DBEngine {
$data = str_replace("SCORE_BOOL_N", "'N'", $data);
$data = str_replace("SCORE_BOOL", "CHAR(1)", $data);
$data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data);
$data = str_replace("SCORE_STRNORM", "", $data);
$data = str_replace("SCORE_STRNORM", "lower", $data);
$data = str_replace("SCORE_ILIKE", "LIKE", $data);
return $data;
}

View File

@ -34,9 +34,7 @@ class PageRequestEvent extends Event {
global $config;
// trim starting slashes
while(strlen($path) > 0 && $path[0] == '/') {
$path = substr($path, 1);
}
$path = ltrim($path, "/");
// if path is not specified, use the default front page
if(strlen($path) === 0) {

View File

@ -64,18 +64,15 @@ class ImageBan extends Extension {
if($hash) {
send_event(new AddImageHashBanEvent($hash, $reason));
flash_message("Image ban added");
$page->set_mode("redirect");
$page->set_redirect(make_link("image_hash_ban/list/1"));
if($image) {
send_event(new ImageDeletionEvent($image));
flash_message("Image deleted");
$page->set_mode("redirect");
$page->set_redirect(make_link("post/list"));
}
$page->set_mode("redirect");
$page->set_redirect($_SERVER['HTTP_REFERER']);
}
}
else if($event->get_arg(0) == "remove") {
@ -84,7 +81,7 @@ class ImageBan extends Extension {
flash_message("Image ban removed");
$page->set_mode("redirect");
$page->set_redirect(make_link("image_hash_ban/list/1"));
$page->set_redirect($_SERVER['HTTP_REFERER']);
}
}
else if($event->get_arg(0) == "list") {

View File

@ -108,10 +108,10 @@ class TagEdit extends Extension {
$owner = User::by_name($_POST['tag_edit__owner']);
send_event(new OwnerSetEvent($event->image, $owner));
}
if($this->can_tag($event->image)) {
if($this->can_tag($event->image) && isset($_POST['tag_edit__tags'])) {
send_event(new TagSetEvent($event->image, $_POST['tag_edit__tags']));
}
if($this->can_source($event->image)) {
if($this->can_source($event->image) && isset($_POST['tag_edit__source'])) {
send_event(new SourceSetEvent($event->image, $_POST['tag_edit__source']));
}
if($user->can("edit_image_lock")) {

6
lib/jquery.ui-1.10.3.custom.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,7 @@ $(document).ready(function() {
$(elm).attr("href", target_id);
// highlight it when clicked
$(elm).click(function(e) {
// This needs jQuery UI
$(target_id).effect('highlight', {}, 5000);
});
// vanilla target name should already be in the URL tag, but this

View File

@ -125,7 +125,7 @@ class Layout {
global $user;
$username = url_escape($user->name);
// hack
$qp = explode("/", @$_GET["q"]);
$qp = explode("/", ltrim(@$_GET["q"], "/"));
$hw = class_exists("Wiki");
// php sucks
switch($qp[0]) {
@ -247,10 +247,10 @@ EOD;
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
*/
$html = null;
$url = $_GET['q'];
$url = ltrim($_GET['q'], "/");
$re1='.*?';
$re2='((?:[a-z][a-z]+))';
$re2='((?:[a-z][a-z_]+))';
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
$url=$matches[1][0];

View File

@ -80,7 +80,7 @@ class Layout {
global $user;
$username = url_escape($user->name);
// hack
$qp = explode("/", @$_GET["q"]);
$qp = explode("/", ltrim(@$_GET["q"], "/"));
$hw = class_exists("Wiki");
// php sucks
switch($qp[0]) {
@ -236,10 +236,10 @@ EOD;
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
*/
$html = null;
$url = $_GET['q'];
$url = ltrim($_GET['q'], "/");
$re1='.*?';
$re2='((?:[a-z][a-z]+))';
$re2='((?:[a-z][a-z_]+))';
if ($c=preg_match_all ("/".$re1.$re2."/is", $url, $matches)) {
$url=$matches[1][0];