九溪

溪水润知林,滴露启慧心

用户工具

站点工具


home

Home

Drupal 信任主机设置

trusted_host_patterns 设置为允许 ^www\.example\.com$

修改 sites/default/settings.php 添加如下代码

$settings['trusted_host_patterns'] = array(
'^www\.example\.com$',
);

参考Protecting against HTTP HOST Header attacks

2018/02/03 20:43

Drupal: 请求FTP权限:Installing modules and themes requires FTP access to your server

The actual problem is that for some beyond retarded reason in modules/update/update.manager.inc on line 706 (in my present setup, drupal 7.2) the following check is performed:

if (fileowner($project_real_location) == fileowner(conf_path()))

with the comments explaining that conf_path() resolves to e.g. sites/default (why the “e.g.” is beyond me - could it be something else?!? or is “i.e.” what the authors meant to say?).

The $project_real_location (how real could it be, it is a temporary location underneath temporary:/“) is where the file is downloaded and extracted.

Depending on the server setup, this can be randomly complicated by a number of factors. Fact is, even if the web server user has all the rights to write all over the place, it wouldn't make any difference. Enjoy wasting your time trying to make it do so.

And why select a location that is generally created manually prior to installation to check its ownership against files actually created by the web server user. There must be a better way to deal with this.

Eventhough, Wordpress is using a similar mechanism (someone is bound to have borrowed it in/from Drupal), they do have a configuration option that overrides this. This is in particular a problem when users can manipulate their setup, but cannot change ownership of files, and especially critical when performing backup, migration, or other maintenance tasks.

Even if there is no easy workaround for this, there has to be at least a hint clarifying exactly what the problem is and how to go about this in case it occurs.

Also note that the web server user may vary. On our setup it was assigned to games (id=5) for whatever reason, so intuitively changing the ownership to www-data (id=33) did not make any difference.

If there is absolutely no way around this, then include an empty file that serves this sole purpose - controlling the write access, but for goodness sake, do not rely on some odd side effects.

I could only join the above user(s) in their frustration! Way to waste people's time!

EDIT: P.S.: Please do excuse my tone, but I can imagine that the time spent on writing this particular piece of code is by no means comparable to the number of users affected by this and the amount of time they wasted trying to figure this out. The impact of this is quite large (just do a random search for issues related to this). Although it is not directly a security issue, it may have led many people to go against common security practices in desperate attempts to fix this (as some “solutions” appear to suggest).

Also, the amount of misinformation being spread regarding this issue, without understanding the actual problem, is quite astounding. There should be absolutely no need to fall back to FTP in this case or to manipulate permissions randomly in hope of fixing the problem (chances are it will not work anyway).

Just run this on your terminal (linux/ubuntu)

sudo chown www-data -R /var/www/html/websitepath/
2018/02/03 20:43

颜色选取按钮

ColorDialog colorDialog1 = new ColorDialog();
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
    //this.btnSelectColor.BackColor = colorDialog1.Color;
    this.tpZZ_LV_layerfield.SelectedItems[0].BackColor = colorDialog1.Color;
}
2018/02/03 20:43

哈希表Hashtable的枚举

foreach( DictionaryEntry de in hashtable1 )
{
    Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
}
foreach (string str in hashtable1.Keys)
{}
string strValue = hashtable1[key]
2018/02/03 20:43

艺术字

wordart.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using System.Data;
using System.Text;
using System.Windows.Forms;
 
public partial class WordArt : UserControl//这是一个艺术字的控件
{      
    //文本属性
    private string _text = "WordArt";
    public string Caption
    {
        get { return _text; }
        set { _text = value; }
    }
    //字体以及大小
    private Font _WordArtFont = new Font("宋体",15);
    public Font WordArtFont
    {
        get { return _WordArtFont; }
        set { _WordArtFont = value; }
    }
    //颜色
    private Color _WordArtForeColor = Color.BlueViolet;
    public Color WordArtForeColor
    {
        get { return _WordArtForeColor; }
        set { _WordArtForeColor = value; }
    }
    //阴影的颜色
    private Color _WordArtBackColor = Color.Gray;
    public Color WordArtBackColor
    {
        set { _WordArtBackColor = value; }
        get { return _WordArtBackColor; }
    }
    //文本输出质量:呈现模式和平滑效果
    private TextRenderingHint _TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
    public TextRenderingHint WordArtTextRenderingHint
    {
        get { return _TextRenderingHint; }
        set { _TextRenderingHint = value; }
    }
 
    public SmoothingMode _SmoothingMode = SmoothingMode.AntiAlias;
    public SmoothingMode WordArtSmoothingMode
    {
        get { return _SmoothingMode; }
        set { _SmoothingMode = value; }
    }
 
    public WordArt()
    {
        InitializeComponent();
    }
    //艺术字的形式:阴影,浮雕……
    private WordArtEffectStyle _WordArtEffect=WordArtEffectStyle.projection;//投影为默认形式;
    public WordArtEffectStyle WordArtEffect
    {
        get { return _WordArtEffect; }
        set { _WordArtEffect = value; }
    }
 
    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);
        Graphics g = this.CreateGraphics();
        Brush backBrush=new SolidBrush(this.WordArtBackColor);
        Brush foreBrush=new SolidBrush(this.WordArtForeColor);
 
        SizeF size = g.MeasureString(this.Caption, this.WordArtFont);
        Single posX = (this.Width - Convert.ToInt16(size.Width)) / 2;
        Single posY = (this.Height - Convert.ToInt16(size.Height)) / 2;
 
        switch (this.WordArtEffect)
        {
            case WordArtEffectStyle.projection://投影效果
                //设置文本输出质量
                g.TextRenderingHint = this.WordArtTextRenderingHint;
                g.SmoothingMode = this.WordArtSmoothingMode;
                Matrix matrix = new Matrix();
                //投射
                matrix.Shear(-1.5f, 0.0f);
                //缩放
                matrix.Scale(1, 0.5f);
                //平移
                matrix.Translate(120, 75);
                //对绘图平面坐标实施变换
                g.Transform = matrix;
                //绘制阴影
                SolidBrush grayBrush = new SolidBrush(this.WordArtBackColor);
                SolidBrush colorBrush = new SolidBrush(this.WordArtForeColor);
                g.DrawString(this.Caption, this.WordArtFont, grayBrush, new PointF(0, 20));
                g.ResetTransform();
                //绘制前景
                g.DrawString(this.Caption, this.WordArtFont, colorBrush, new PointF(0,20));
                break;
            case WordArtEffectStyle.embossment://浮雕效果
                backBrush = Brushes.Black;
                foreBrush = Brushes.White;
 
                g.DrawString(this.Caption, this.WordArtFont, backBrush, posX + 1, posY + 1);
                g.DrawString(this.Caption, this.WordArtFont, foreBrush, posX, posY );
                break;
            case WordArtEffectStyle.forme://印版效果
                int i = 0;
                backBrush = new SolidBrush(this.WordArtBackColor);
                foreBrush = new SolidBrush(this.WordArtForeColor);
                while (i < 20)
                {
                    g.DrawString(this.Caption, this.WordArtFont, backBrush, posX - i, posY + i);
                    i = i + 1;
                }
                g.DrawString(this.Caption, this.WordArtFont, foreBrush, posX, posY);
                break;
            case WordArtEffectStyle.Reflection://倒影效果
                backBrush = new SolidBrush(this.WordArtBackColor);
                foreBrush = new SolidBrush(this.WordArtForeColor);
 
                g.TranslateTransform(posX, posY);
 
                int ascent = this.WordArtFont.FontFamily.GetCellAscent(this.WordArtFont.Style);
                int spacing = this.WordArtFont.FontFamily.GetLineSpacing(this.WordArtFont.Style);
                int lineHeight = System.Convert.ToInt16(this.WordArtFont.GetHeight(g));
                int height = lineHeight * ascent / spacing;
 
                GraphicsState state = g.Save();
                g.ScaleTransform(1, -1.0f);
                g.DrawString(this.Caption, this.WordArtFont, backBrush, 0, -height);
                g.Restore(state);
                g.DrawString(this.Caption,this.WordArtFont, foreBrush, 0, -height);
                break;
            case WordArtEffectStyle.shadow://阴影效果
                Brush shadowBrush = Brushes.Gray;
                foreBrush = new SolidBrush(this.WordArtBackColor);
                posX = (this.Width - Convert.ToInt16(size.Width)) / 4;
                posY = (this.Height - Convert.ToInt16(size.Height)) / 3;
                g.DrawString(this.Caption, this.WordArtFont, shadowBrush, posX + 20, posY + 20);
                g.DrawString(this.Caption, this.WordArtFont, foreBrush, posX, posY);
                break;
            case WordArtEffectStyle.grain://纹理的效果
 
                break;
 
            case WordArtEffectStyle.slope://倾斜
                g.TranslateTransform(posX, posY);
                Matrix transform = g.Transform;
                //右倾斜文字
                //float shearX = -0.230F; 
                //左倾斜文字
                float shearX = 0.550F;
                float shearY = 0.10F;
                transform.Shear(shearX, shearY);
                g.Transform = transform;
                g.DrawString(this.Caption, this.WordArtFont, foreBrush, 0, 0);
                break;
            case WordArtEffectStyle.shadeLines://渐变
                Brush ShadowBrush = Brushes.Gray;
                PointF point = new PointF(0, 0);
                RectangleF rectangle = new RectangleF(point, size);
                Brush brush = new LinearGradientBrush(rectangle, Color.Red, Color.Green, LinearGradientMode.Horizontal);
                int xwidth = (this.Width - Convert.ToInt16(size.Width)) / 2;
                int xheight = (this.Height - Convert.ToInt16(size.Height)) / 2;
                g.DrawString(this.Caption,this.WordArtFont, brush, xwidth, xheight);
                break;
            case WordArtEffectStyle.circumgyrate://旋转
                for (int n = 0; n <= 360; n += 30)
                {
                    //平移到对象中心
                    g.TranslateTransform(this.Width / 2, this.Height / 2);
                    //设置Graphics对象的输出角度
                    g.RotateTransform(n);
                    //设置文字填充颜色
                    g.DrawString(this.Caption, this.WordArtFont, foreBrush, 0, 0);
                    //恢复全局变换矩阵
                    g.ResetTransform();
                }
                break;
        }
    }
}
public enum WordArtEffectStyle
{
    //投影,浮雕,印版,倒影,阴影,纹理, 倾斜,渐变,旋转
    projection, embossment, forme, Reflection, shadow, grain, slope, shadeLines, circumgyrate
}
2018/02/03 20:43

评论

1xbet, 2025/04/30 12:14

I'd suggest this article to everyone curious about this field. Clear descriptions of important ideas. 1xbet

1xbet, 2025/04/30 12:14

I'd suggest this article to everyone curious about this field. Clear descriptions of important ideas. 1xbet

1xbet, 2025/04/30 11:35

I completely concur with your main argument. Additionally, I would add that this aspect is equally important. 1xbet

1xbet, 2025/04/30 11:35

I completely concur with your main argument. Additionally, I would add that this aspect is equally important. 1xbet

mostbet РФ, 2025/04/29 13:44

mostbet РФ Your fortune awaits! Enjoy exclusive bonuses! Stay tuned for special events! Subscribe to our newsletter for more! Play big! Tell your colleagues about us! Huge thanks for being part of us! Very professional! Our site is fantastic! Following your latest events! Liked and registered! You're an undisputed expert! Will share with on social media! Thank you for your assistance! Very rewarding experience! Your efforts always lead to wins! mostbet играть mostbet Кыргызстан mostbet mostbet kz

mostbet РФ, 2025/04/29 13:44

mostbet РФ Your fortune awaits! Enjoy exclusive bonuses! Stay tuned for special events! Subscribe to our newsletter for more! Play big! Tell your colleagues about us! Huge thanks for being part of us! Very professional! Our site is fantastic! Following your latest events! Liked and registered! You're an undisputed expert! Will share with on social media! Thank you for your assistance! Very rewarding experience! Your efforts always lead to wins! mostbet играть mostbet Кыргызстан mostbet mostbet kz

mostbet Azərbaycan, 2025/04/27 22:59

mostbet Azərbaycan Hit the jackpot with us! Unlock your fortune! Play with ease on our licensed platform! Don't miss out on huge jackpots! Win big! Share the joy with friends! Grateful for your loyalty! Simply fantastic! Your efforts always result in victories! Eagerly awaiting your upcoming tournaments! Bookmarked your content in my browser! You're the best! Telling everyone! Thanks for the rewarding experience! Very exciting promotion! Your skills always are rewarded! mostbet ru mostbet mostbet today mostbet Киргизия

mostbet Azərbaycan, 2025/04/27 22:59

mostbet Azərbaycan Hit the jackpot with us! Unlock your fortune! Play with ease on our licensed platform! Don't miss out on huge jackpots! Win big! Share the joy with friends! Grateful for your loyalty! Simply fantastic! Your efforts always result in victories! Eagerly awaiting your upcoming tournaments! Bookmarked your content in my browser! You're the best! Telling everyone! Thanks for the rewarding experience! Very exciting promotion! Your skills always are rewarded! mostbet ru mostbet mostbet today mostbet Киргизия

1win, 2025/04/09 18:09

¡La fortuna te acompaña! No pierdas la oportunidad de disfrutar de apuestas seguros y entretenidas en 1Win. 1win

1win, 2025/04/09 18:09

¡La fortuna te acompaña! No pierdas la oportunidad de disfrutar de apuestas seguros y entretenidas en 1Win. 1win

bet9ja old mobile, 2025/04/09 18:07

Discover Bet9ja: The Best Betting Experience in Nigeria!

bet9ja old mobile Looking for a simple betting experience? Access the Bet9ja Old Mobile version and experience fast loading times and easy navigation. Bet on soccer, casino games, and virtual races without the complexities of the new version. Start betting in minutes!

old bet9ja

bet9ja old mobile, 2025/04/09 18:07

Discover Bet9ja: The Best Betting Experience in Nigeria!

bet9ja old mobile Looking for a simple betting experience? Access the Bet9ja Old Mobile version and experience fast loading times and easy navigation. Bet on soccer, casino games, and virtual races without the complexities of the new version. Start betting in minutes!

old bet9ja

pinco, 2025/04/09 18:05

Pinco Casino'da eğlence sizi bekliyor! pinco

Pinco Casino'da hızla kayıt olabilirsiniz. Bonuslu oyunlar ve yüksek ödeme oranları ile oyun deneyiminizi zenginleştirin. pinco

pinco, 2025/04/09 18:05

Pinco Casino'da eğlence sizi bekliyor! pinco

Pinco Casino'da hızla kayıt olabilirsiniz. Bonuslu oyunlar ve yüksek ödeme oranları ile oyun deneyiminizi zenginleştirin. pinco

pin up casino india, 2025/04/09 18:04

Exciting casino options await you at Pin-Up! At Pin-Up Casino, you'll find engaging slot games, table games, sports wagers, and much more. Play premium games from top providers like NetEnt and Microgaming, and take your chance for huge wins!

pin up casino india Maximizing the ?450000 Welcome Bonus at Pin-Up Casino. The Pin Up casino welcome offer of up to ?450000 is generous, but how can you take full advantage of it? Have you received this offer yet? Let us know your strategies and tips for transforming the bonus into huge payouts. Let’s talk about how to make the most out of your first top-up!

pin up casino india, 2025/04/09 18:04

Exciting casino options await you at Pin-Up! At Pin-Up Casino, you'll find engaging slot games, table games, sports wagers, and much more. Play premium games from top providers like NetEnt and Microgaming, and take your chance for huge wins!

pin up casino india Maximizing the ?450000 Welcome Bonus at Pin-Up Casino. The Pin Up casino welcome offer of up to ?450000 is generous, but how can you take full advantage of it? Have you received this offer yet? Let us know your strategies and tips for transforming the bonus into huge payouts. Let’s talk about how to make the most out of your first top-up!

taya365 app, 2025/04/09 18:04

Use Taya365 bonuses for maximum victories taya365 app Uncover the world of online gaming with Taya365 and enjoy top-notch live games. Register today to receive huge rewards and bonuses! Taya365 and enjoy a world of adventure. Whether you're into sports betting, there's something to enjoy. Get started and win big! taya365 app download

taya365 app, 2025/04/09 18:04

Use Taya365 bonuses for maximum victories taya365 app Uncover the world of online gaming with Taya365 and enjoy top-notch live games.

Register today to receive huge rewards and bonuses! Taya365 and enjoy a world of adventure. Whether you're into sports betting, there's something to enjoy. Get started and win big! taya365 app download

Online betting in Egypt, 2025/04/04 06:20

دائماً أراهن في 1xbet Sports Betting Egypt – مضمون ومربح! أوصي به الآن! Online betting in Egypt

Online betting in Egypt, 2025/04/04 06:20

دائماً أراهن في 1xbet Sports Betting Egypt – مضمون ومربح!

أوصي به الآن! Online betting in Egypt

Mostbet BD, 2025/04/03 05:44

Mostbet জুয়া – বিশাল প্ল্যাটফর্ম ভার্চুয়াল গেমস জন্য। Mostbet BD

Mostbet BD, 2025/04/03 05:44

Mostbet জুয়া – বিশাল প্ল্যাটফর্ম ভার্চুয়াল গেমস জন্য। Mostbet BD

mostbet kazakhstan, 2025/04/01 04:33

Онлайн казино Mostbet – кең ауқымды мүмкіндіктер ұсынады спорттық ставкалар сүйінушілеріне.

mostbet kazakhstan

mostbet kazakhstan, 2025/04/01 04:33

Онлайн казино Mostbet – кең ауқымды мүмкіндіктер ұсынады спорттық ставкалар сүйінушілеріне. mostbet kazakhstan

mega moriarty, 2025/03/30 23:23

На данном сайте всегда доступна актуальная ссылка на мега мориарти, которая обновляется регулярно, чтобы вы могли без проблем попасть на нужную платформу.

mega moriarty, 2025/03/30 23:23

На данном сайте всегда доступна актуальная ссылка на мега мориарти, которая обновляется регулярно, чтобы вы могли без проблем попасть на нужную платформу.

why 1xbet is the best online casino site for UAE players Thank you for your openness and openness! �� 400 Bad Request

why 1xbet is the best online casino site for UAE players Thank you for your openness and openness! �� 400 Bad Request

1xBet تسجيل, 2025/03/19 08:29

دائماً أراهن في 1xbet مصر – مضمون ومثالي! جربه بنفسك الآن! 1xBet تسجيل

1xBet تسجيل, 2025/03/19 08:29

دائماً أراهن في 1xbet مصر – مضمون ومثالي! جربه بنفسك الآن! 1xBet تسجيل

1xBet عروض ترويجية, 2025/03/17 21:23

جربت 1xbet Mobile App Egypt – يتميز بواجهة ممتازة، السحب دون مشاكل!

1xBet عروض ترويجية

1xBet عروض ترويجية, 2025/03/17 21:23

جربت 1xbet Mobile App Egypt – يتميز بواجهة ممتازة، السحب دون مشاكل!

1xBet عروض ترويجية

Jogar FortuneRabbit sempre foi tão simples., 2025/03/14 23:47

هل تحتاج إلى أشهر شركة رهان؟ 1xbet شركة الرهان يقدم أقوى الفرص ودفعات سريعة! Jogar FortuneRabbit sempre foi tão simples.

Nam, 2025/03/14 23:47

هل تحتاج إلى أشهر شركة رهان؟ 1xbet شركة الرهان يقدم أقوى الفرص ودفعات سريعة!

Jogar FortuneRabbit sempre foi tão simples.

1xBet in Egypt, 2025/03/04 22:58

دائماً أشارك في 1xbet Sports Betting Egypt – مريح ومربح! أنصح به الآن! 1xBet in Egypt

Dalene, 2025/03/04 22:57

دائماً أشارك في 1xbet Sports Betting Egypt – مريح ومربح! أنصح به الآن! 1xBet in Egypt

1xBet تطبيق الجوال, 2025/03/04 09:47

هل تبحث عن أقوى كازينو أونلاين؟ 1xbet Egypt يقدم أفضل العروض ودفعات سريعة! 1xBet تطبيق الجوال

Sherlyn, 2025/03/04 09:47

هل تبحث عن أقوى كازينو أونلاين؟ 1xbet Egypt يقدم أفضل العروض ودفعات سريعة! 1xBet تطبيق الجوال

Apostas em futebol, 2025/02/18 15:48

دائماً أراهن في 1xbet مصر – مريح ومثالي!

أنصح به الآن! Apostas em futebol

Jamel, 2025/02/18 15:48

دائماً أراهن في 1xbet مصر – مريح ومثالي! أنصح به الآن! Apostas em futebol

请输入您的评论. 可以使用维基语法:
 
home.txt · 最后更改: 2025/02/27 17:17 由 colin