diff --git a/contrib/link_image/test.php b/contrib/link_image/test.php index e0f8cb52..83f641f7 100644 --- a/contrib/link_image/test.php +++ b/contrib/link_image/test.php @@ -10,8 +10,10 @@ class LinkImageTest extends ShimmieWebTestCase { $matches = array(); preg_match("#value='(http://.*(/|%2F)post(/|%2F)view(/|%2F)[0-9]+)'#", $raw, $matches); $this->assertTrue(count($matches) > 0); - $this->get($matches[1]); - $this->assert_title("Image $image_id: pie"); + if($matches) { + $this->get($matches[1]); + $this->assert_title("Image $image_id: pie"); + } $this->log_out(); diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index de64291a..ea5815c9 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -245,7 +245,7 @@ class Image { global $database; if($owner->id != $this->owner_id) { $database->execute("UPDATE images SET owner_id=:owner_id WHERE id=:id", array("owner_id"=>$owner->id, "id"=>$this->id)); - log_info("core-image", "Owner for Image #{$this->id} set to: ".$owner->username); + log_info("core-image", "Owner for Image #{$this->id} set to {$owner->name}"); } } diff --git a/core/page.class.php b/core/page.class.php index 3761f4b2..48719ef1 100644 --- a/core/page.class.php +++ b/core/page.class.php @@ -251,28 +251,28 @@ class Page { // caching failed, add all files to html_headers. foreach(glob("lib/*.css") as $css) { - $this->add_html_header(''); + $this->add_html_header(''); } $css_files = glob("ext/*/style.css"); if($css_files) { foreach($css_files as $css_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } $css_files = glob("themes/$theme_name/style.css"); if($css_files) { foreach($css_files as $css_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } foreach(glob("lib/*.js") as $js) { - $this->add_html_header(''); + $this->add_html_header(''); } $js_files = glob("ext/*/script.js"); if($js_files) { foreach($js_files as $js_file) { - $this->add_html_header(''); + $this->add_html_header(''); } } } diff --git a/core/util.inc.php b/core/util.inc.php index e9a8583d..552266be 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -339,6 +339,13 @@ function make_form($target, $method="POST", $multipart=False, $form_id="", $onsu return '
'.$auth; } +function mtimefile($file) { + $data_href = get_base_href(); + $mtime = filemtime($file); + return "$data_href/$file?$mtime"; +} + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * CAPTCHA abstraction * diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index 8e485f19..9907d5e1 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -108,21 +108,21 @@ class TagEdit extends Extension { public function onOwnerSet(OwnerSetEvent $event) { global $user; - if($user->can("edit_image_owner") || !$event->image->is_locked()) { + if($user->can("edit_image_owner") && (!$event->image->is_locked() || $user->can("lock_image"))) { $event->image->set_owner($event->owner); } } public function onTagSet(TagSetEvent $event) { global $user; - if($user->can("edit_image_tag") || !$event->image->is_locked()) { + if($user->can("edit_image_tag") && (!$event->image->is_locked() || $user->can("lock_image"))) { $event->image->set_tags($event->tags); } } public function onSourceSet(SourceSetEvent $event) { global $user; - if($user->can("edit_image_source") || !$event->image->is_locked()) { + if($user->can("edit_image_source") && (!$event->image->is_locked() || $user->can("lock_image"))) { $event->image->set_source($event->source); } }