From eb5d2c945f0b71f6321dee10eea68f87f11f351d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 13 Nov 2009 14:49:23 -0500 Subject: [PATCH] make backend generate from id work staticly --- classes/backends/ComicPressBackendAttachment.inc | 4 ++-- test/backends/ComicPressBackendAttachmentTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/backends/ComicPressBackendAttachment.inc b/classes/backends/ComicPressBackendAttachment.inc index dd4013a..8b0e8d9 100644 --- a/classes/backends/ComicPressBackendAttachment.inc +++ b/classes/backends/ComicPressBackendAttachment.inc @@ -77,8 +77,8 @@ class ComicPressBackendAttachment extends ComicPressBackend { } function generate_from_id($id) { - if (strpos($id, $this->root_id . '-') === 0) { - $id = str_replace($this->root_id . '-', '', $id); + if (strpos($id, 'attachment-') === 0) { + $id = str_replace('attachment-', '', $id); if (is_numeric($id)) { $post = get_post($id); if (!empty($post)) { diff --git a/test/backends/ComicPressBackendAttachmentTest.php b/test/backends/ComicPressBackendAttachmentTest.php index c129f3a..8aa3322 100644 --- a/test/backends/ComicPressBackendAttachmentTest.php +++ b/test/backends/ComicPressBackendAttachmentTest.php @@ -98,7 +98,7 @@ class ComicPressBackendAttachmentTest extends PHPUnit_Framework_TestCase { $return = false; } - $this->assertEquals($return, $this->ba->generate_from_id($id)); + $this->assertEquals($return, call_user_func(array('ComicPressBackendAttachment', 'generate_from_id'), $id)); } function testGetInfo() {