Joomler!.net - Decided on Joomla!

デル株式会社

Jboard is Multiple Board!

Home » Blog » Error
0 votes
Written by:Joomler! 1169 hits Saturday, 16 April 2011 10:32

image

早速、http://demo16.joomler.netをアップグレード。全ファイルをFTPで上書きし、サイトを開く・・・。

Internal Server Error

おっとっと・・・大抵こういう場合、設定済みのhtaccessを上書きしてしまった場合に多い。htaccess.txtでアップグレードファイルには付属されていたが、ローカル上で.htaccessに直しアップロードしている。今回は、RewriteBaseのコメントを外すことで完了。

修正内容はたくさんあるようだし、中レベル(どんなレベル?)の脆弱性も修正されているようなので、早めにアップグレードされた方が良いと思います。

Joomlaに限らず、DrupalやWordpressにしても、たくさんのユーザーに支えられているシステムはこうやって更新されていくことが最大のメリットですね。

 
0 votes
Written by:Joomler! 5578 hits Wednesday, 19 March 2008 16:42

Fireboardのファイルとイメージのアップロードで以前から不満に思っていたのですが、アップロードに失敗などすると二度とアップロードできなくなってしまわないですか?これは、データベースに登録されてしまうとアップロード済みになってしまい、ファイルの存在の有無にかかわらずアップロードされていると判断しているからのようです。

以下のようにアップロード済みでファイルが存在するならタグを表示するようにしました。

fireboard_hack_upload.jpg

Root/components/com_fireboard/template/default/post.php

foreach ($attachments as $att)
{
 if (preg_match("&/fbfiles/files/&si", $att->filelocation)) {
  $no_file_upload = "1";
 }
 
 if (preg_match("&/fbfiles/images/&si", $att->filelocation)) {
  $no_image_upload = "1";
 }
}

$upload_files = array();
$upload_images = array();
foreach ($attachments as $att)
{
 if (preg_match("&/fbfiles/files/&si", $att->filelocation) && file_exists($att->filelocation)) {
  $no_file_upload = "1";
  $upload_files[] = '[file]'. str_replace($mosConfig_absolute_path, $mosConfig_live_site, $att->filelocation). '[/file]';
 }
 
 if (preg_match("&/fbfiles/images/&si", $att->filelocation) && file_exists($att->filelocation)) {
  $no_image_upload = "1";
  $upload_images[] = '[img]'. str_replace($mosConfig_absolute_path, $mosConfig_live_site, $att->filelocation). '[/img]';
 }
}

に変更。そしてこのとき追加した$upload_filesと$upload_imagesを次のファイルで使います。

Root/components/com_fireboard/template/default/fb_write.html.php

if (($fbConfig['allowImageUpload'] || ($fbConfig['allowImageRegUpload'] && $my->id != 0) || $is_moderator) && ($no_upload == "0" || $no_image_upload == "0"))
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry1">
        <td class = "fb_leftcolumn">
            <strong><?php echo _IMAGE_SELECT_FILE; ?></strong>
        </td>

        <td>
            <input type = 'file' class = 'button' name = 'attachimage' onmouseover = "helpline('iu')"/>

            <input type = "button" class = "button" name = "addImagePH" value = "<?php echo _POST_ATTACH_IMAGE;?>" style = "cursor:hand; width: 40px" onclick = "javascript:emo(' [img] ');" onmouseover = "helpline('ip')"/>
        </td>
    </tr>

<?php
}
?>

<?php
if (($fbConfig['allowFileUpload'] || ($fbConfig['allowFileRegUpload'] && $my->id != 0) || $is_moderator) && ($no_upload == "0" || $no_file_upload == "0"))
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry2">
        <td class = "fb_leftcolumn">
            <strong><?php echo _FILE_SELECT_FILE; ?></strong>
        </td>

        <td>
            <input type = 'file' class = 'button' name = 'attachfile' onmouseover = "helpline('fu')" style = "cursor:hand"/>

            <input type = "button" class = "button" name = "addFilePH" value = "<?php echo _POST_ATTACH_FILE;?>" style = "cursor:hand; width: 40px" onclick = "javascript:emo(' [file] ');" onmouseover = "helpline('fp')"/>
        </td>
    </tr>

<?php
}

if (($fbConfig['allowImageUpload'] || ($fbConfig['allowImageRegUpload'] && $my->id != 0) || $is_moderator) && ($no_upload == "0" || $no_image_upload == "0"))
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry1">
        <td class = "fb_leftcolumn">
            <strong><?php echo _IMAGE_SELECT_FILE; ?></strong>
        </td>

        <td>
            <input type = 'file' class = 'button' name = 'attachimage' onmouseover = "helpline('iu')"/>

            <input type = "button" class = "button" name = "addImagePH" value = "<?php echo _POST_ATTACH_IMAGE;?>" style = "cursor:hand; width: 40px" onclick = "javascript:emo(' [img] ');" onmouseover = "helpline('ip')"/>
        </td>
    </tr>

<?php
}
if (($fbConfig['allowImageUpload'] || ($fbConfig['allowImageRegUpload'] && $my->id != 0) || $is_moderator) && count($upload_images) && $no_image_upload == "1")
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry1">
        <td class = "fb_leftcolumn">
            <strong>アップロード済みイメージ</strong>
        </td>

        <td>
         <?php echo implode('<br />', $upload_images); ?>
        </td>
    </tr>

<?php
}
if (($fbConfig['allowFileUpload'] || ($fbConfig['allowFileRegUpload'] && $my->id != 0) || $is_moderator) && ($no_upload == "0" || $no_file_upload == "0"))
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry2">
        <td class = "fb_leftcolumn">
            <strong><?php echo _FILE_SELECT_FILE; ?></strong>
        </td>

        <td>
            <input type = 'file' class = 'button' name = 'attachfile' onmouseover = "helpline('fu')" style = "cursor:hand"/>

            <input type = "button" class = "button" name = "addFilePH" value = "<?php echo _POST_ATTACH_FILE;?>" style = "cursor:hand; width: 40px" onclick = "javascript:emo(' [file] ');" onmouseover = "helpline('fp')"/>
        </td>
    </tr>

<?php
}
if (($fbConfig['allowFileUpload'] || ($fbConfig['allowFileRegUpload'] && $my->id != 0) || $is_moderator) && count($upload_files) && $no_file_upload == "1")
{
?>

    <tr class = "<?php echo $boardclass; ?>sectiontableentry2">
        <td class = "fb_leftcolumn">
            <strong>アップロード済みファイル</strong>
        </td>

        <td>
        <?php echo implode('<br />', $upload_files); ?>
        </td>
    </tr>

<?php
}

に変更。これでアップロード済みのファイルがあって且つファイルが存在していれば、アップロードフォームに代わってコピーして使えるタグ(自分で選択してコピーしないと駄目ですけど)が表示されます。
※メッセージなどは、好みで変更されたら良いと思うし、そこまでしなくてもと思われるなら、最初の変更分で$upload_files、$upload_imagesを定義しなければfb_write.html.phpも変更しなくてOKですね。


TagsError
 

JContentPlus for Joomla!1.5 powered by Joomler!.net

joomler.net is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla!(R) name is used under a limited license from Open Source Matters in the United States and other countries.
joomler.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.