mediawiki,user-agent,googlebot , googlebot reading site in incorrect language

googlebot reading site in incorrect language


Tag: mediawiki,user-agent,googlebot

My site was hacked and the useragent is sending googlebot the incorrect page. It looks like it is reading it the wrong language as a result of the extra code:

dir="ltr" lang="ja" xml:lang="ja"> <head>
 <meta http-equiv="Content-Type" 
http-equiv="content-type" content="text/html; charset=UTF-8" />

I can't find where the code is in the files. It is a mediawiki site. How do I fix this?


The hack was in the index.php file. I removed the code that was including a page created by the hackers.


How to specify a default content in the text editor on MediaWiki page creation?

On a MediaWiki, I would like that when someone creates a new page, the content of the text editor is automatically set to a certain value. For instance when one creates a new page called MyPage, the content of the text editor would be: Please modify this content and then...

How does MediaWiki sort page links in category overviews?

The answer should be: alphabetically. Currently, I have a page starting with 'A' appearing in the 'S' section of the category overview page. Screenshot: I have a small Wiki running for my team: MediaWiki 1.22.2 PHP 5.3.29 (litespeed) MariaDB 5.5.40-MariaDB and this is the first time I have ever...

Check if mobile or not based on User Agent string [closed]

One way to check could be based on the device width, but that definitely is not concrete. Are there any UA parsers/libraries to help identify this based on user agent string? Thanks!...

Mediawiki custom namespaces id change

I am currently working on an internal Mediawiki and we are using a lot of custom written extensions. Because we did no know better, defined custom namespaces for our own extensions and articles with an id that is smaller than 3000. For example: define('NS_bla', 1100); $wgExtraNamespaces[NS_bla] = "bla"; define('NS_bla_TALK', 1101);...

What kind of CSS is this?

I was looking at an old installation of mediawiki which is not rendering css properly the code in the Chrome Dev Tools is showing CSS like this {{{border-width|1}}}px solid {{{titleborder|{{{border|#ababab}}}}}} Not able to understand what is the pre-processor used and why its not working. Can someone hint to some direction....

How to set User Agent in QtWebEngine QML application

NOTE: I was able to do that on QtWebKit QML using the QtWebView extension. Here I am interested in using QtWebEngine. My simple test application import QtQuick 2.1 import QtQuick.Controls 1.1 import QtWebEngine 1.0 ApplicationWindow { width: 800 height: 600 color: "lightgray" visible: true WebEngineView { id: webview url:...

MediaWiki page edit causes “Load denied by X-Frame-Options: does not permit cross-origin framing”

I am running a MediaWiki on a VM, accessing it through -- I was able to edit pages. Now I've redirected my domain to does indeed find my wiki, but when I attempt to edit a page I get a blank page. Inspecting the console yields:...

Mediawiki: Error sending mail

I'm absolutely new to MediaWiki. I've installed it, set up smtp settings and trying to create a new user with sending him a password by email. But I'm getting the following error: Account creation error Error sending mail: Validation failed for: =?UTF-8?Q?=D0=92=D0=B8=D0=BA=D0=B8=20=D0=BC=D1=83=D0=B6=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D1=85=D1=80=D0=B8=D1=81=D1=82=D0=B8=D0=B0=D0=BD=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D1=81=D1=82=D0=B2=D0=B0=20"=D0=9F=D1=83=D1=82=D1=8C"?= My email settings in LocalSettings.php...

List of User-agent for browser

Where can I find list of User-Agent which I can use in: webBrowser1.Navigate("http://localhost/run.php", null, null, "User-Agent: Here Put The User Agent"); Thank you for your reply....

Prevent User Agent malicious code with PHP [closed]

I have this PHP code, for a Wordpress plugin. How can I prevent user agent malicious code injection? I added if (preg_match('/script/',$agent)) { $agent = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $agent); for prevent only javascript malicious code, but is not enough for the other attacks. Someone suggested me to encode the html entities...

Can a form insert preformatted text within an existing Mediawiki page?

I want unskilled users to be able to make a personal entry in a "Member Lookup" page, which I've implemented as a table in standard Mediawiki markup. I have a large userbase, most of which is not skilled Mediawiki editors. They all have edit permissions, just not skill or interest....

Generate Get Request with No User Agent,.net,google-chrome,browser,user-agent
I have a website that has been experiencing errors because of null references due to poorly coded logic regarding the user agent. Basically, there has been a slew of incoming requests that contain no user agent which leads to null reference exceptions in the user agent tracking. (It contained a...

Is it possible to continue numbering after inserting a table?

I want my list to show up as: 1. Step 1 2. Step 2: <table> 3. Step 3 but it shows up as: 1. Step 1 2. Step 2: <table> 1. Step 3 Code: # Step 1 # Step 2: :: {| ... |} # Step 3 Is it possible...

Hand over parameters from a MediaWiki template to a included one

I'm using the MediaWiki extension DynamicPageList (third-party) which can be used as a template: {{#dpl: |category=foo |notcategory=bar }} I try to use this template in one of my templates which uses more parameter e.g.: {{myTemplate |category=foo |notcategory=bar |mypara1=bla |mypara2=lala }} myTemplate looks like this: do something with mypara1 ... do...

Testing for user agent spoofing in python

I'm new to python and using python 3. I'm trying to download a webpage and what I want to know is if there is a way to actually see the name of the user agent the way a system admin or google sees it. In my code I download and...

googlebot reading site in incorrect language

My site was hacked and the useragent is sending googlebot the incorrect page. It looks like it is reading it the wrong language as a result of the extra code: dir="ltr" lang="ja" xml:lang="ja"> <head> <meta http-equiv="Content-Type" http-equiv="content-type" content="text/html; charset=UTF-8" /> I can't find where the code is in the files....

Pretty URLs aren't working after upgrade to Mediawiki 1.24.2

So I am moving a Mediawiki site of mine to a new server. The version 1.20.3 worked fine on the old server running Ubuntu 12.04. However, when I copied everything over to my new server running Ubuntu 14.04 it didn't. So after messing with it for a while I decided...

All my mediawiki pages are blank after PHP upgrade

Server Team upgraded PHP version to latest 5.6.5. Now All pages are blank. Could you please guide me how to resolve this. MediaWiki Version: 1.20.2 Thanks!

ASP.Net WebAPI has different content type in different user agents

I am trying to learn ASP.Net WebAPI, and I am having a hard time figuring out what is going on. I created a small application that contains an action like this: public IHttpActionResult Hello() { return Ok("Hi"); } This works fine, so I look at it in the browser. I...

MediaWiki cant get LDAP authentication to work

I am running out of ideas here. I cant get LDAP authentication to work on my network, i have a local machine (Linux Ubuntu 14 with mediawiki) Domain Name - XXXX Domain Controllers - OBI1.XXXX.local cg-p-dc-04.XXXX.local cg-p-dc-05.XXXX.local Here is my LocalSettings.php require_once "$IP/extensions/LdapAuthentication/LdapAuthentication.php"; $wgAuth = new LdapAuthenticationPlugin(); $wgLDAPDomainNames = array(...

Why use ImageMagick in CMS like MediaWiki instead of simply using browser methods?

Can somebody explain to me why I should possibly use ImageMagick (or the fork GraphicsMagick) in a CMS instead of simply displaying and sizing my images via CSS? The browser methods cannot fail and are automatically updated on client side, the ImageMagick-binary can fail on the server and I have...

How to not reveal a third party secret api key in MediaWiki

I've got an API key from and I want to use it with the MediaWiki extension External Data. But if I put it as plain wikitext it will be in plain sight. Is there a simple way to add it as a custom variable in LocalSettings.php and then call...

How does Composer know what MediaWiki extensions to load?

We've switched from using Semantic Bundle to install extensions by using Composer. Now we can skip, for some extensions, manually including entry points at the LocalSettings.php file ( But how does MediaWiki know which extensions to load. Does it read composer.json?

What API does facebook use for displaying the full wikipedia articles?

I couldn't find any api that return the article in a usable html form. Most of them return extracts which have very poor HTML formatting which makes them useless for anything.

How do I add Special:PrefixIndex/FULLPAGENAME to the toolbox in my local MediaWIki installation?

I would like a tool in the sidebar's "Tools" section that takes readers to Special:PrefixIndex/FULLPAGENAME where FULLPAGENAME is replaced with the current page's full name. For example, say I was on the page Module:Citation/CS1 then I would like a tool in the sidebar called Subpages that takes me to Special:PrefixIndex/Module:Citation/CS1....

Convert docx to mediawiki and preserve [[Image:]]

Currently, I'm trying to move a docx to a mediawiki file and preserve the proper filenames in the [[Image:]] tags. For some reason, the proper image file gets swallowed (ie, normally it'd be media/image4.jpg, but instead it's just empty). I've tried extracting the docx and looking at docx/word/_rels/document.xml.rels but I...

Where can I find the code that convert internal MediaWiki links into article URLs?

I need to replicate exactly, Wikipedia's behavior regarding the conversion of [[links]] in the page body to URLs that open the articles they refer to. The link syntax and its behavior (conversion) are described here. While that article only mentions a few very basic modifications being applied, I think that's...

Retrive first paragraph from Wikipedia in Chinese

I want to retrieve the first paragraph of Wikipedia in Chinese language. I found an API; but it returns data in English. How can I get data from this API in Chinese language?...

Mediawiki Call hook function from another file

Hello I need to save some content to database in MediaWiki when a new page is created. So I added hook in my LocalSettings.php: $wgHooks['PageContentSaveComplete'][] ='assign_responsibility'; But I need to call the function assing_responsibility() from a extension php file Responsibility.php not LocalSettings. I am new at Mediawiki system and I...

texvc does not render latex math in Mediawiki

I have the Math extension installed in my MediaWiki 1.19. After I updated Ubuntu Server from 12.04 to 14.04 something seems to have messed it up and it has stopped working. Basically I get the following error when I try to display anything between the <math> and </math> tags: Failed...

About Airbnb video jumbotron for iPad

When visiting Airbnb from PC/MAC browsers, the homepage jumbotron will use HTML5 video as background even you resize browser to a quite small size (meaning it's not just media query). But when you use a tablet like iPad, the jumbotron will use image carousel instead. Is it something like user...

How to compare string to String Array in C#?

I have an string; String uA = "Mozilla/5.0 (iPad; CPU OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12D508 Twitter for iPhone"; String[] a= {"iphone","ipad","ipod"}; It must return ipad because ipad is in the first match ipad at the string. In other case String uA = "Mozilla/5.0 (iPhone/iPad;...

Change UserAgentString with Selenium Chrome

How do I, using Selenium (Python), change the UAS (User Agent String) on a webdriver.Chrome() Instance? I do automated tests, and use more than just Firefox. With firefox my quest is simple, but to get the same result on Chrome, i am at a loss....

HTML - How to show different image in different user agents?

If I use Chrome I want to show img1.jpg (<img src="img1.jpg" alt="my Chrome Image">). Otherwise, if I use IE, I want to show img2.jpg (<img src="img2.jpg" alt="my IE Image">). Is it possible? Thanks in advance....

Can I set different colours for content contributed by different users in MediaWiki?

Is there a way of assigning default colours for content contributed by different users in MediaWiki? For example, I would like to have content contributed by user A green by default, by user B blue by default etc....

Detect Chrome iPhone 6+

I used to use: (window.navigator.userAgent.indexOf('Android') > -1 && (/Chrome\/[.0-9]*/).test(window.navigator.userAgent)) || navigator.userAgent.match('CriOS'); to detect Chrome on iOS devices, but it appears the user agent on Chrome for the 6+ is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10 (000578) I've also used device.js in the past...

Redirect based on operating system

I'm new here and I apologize if this question is basic/stupid. I am not too familiar with coding, so please excuse my ignorance/glaring errors. I have tried to put this together using code snippets found online and luckily I don't have to code too much for this project. I am...

urllib2 request returns a different page about 1 in 5 times

import urllib2 req = urllib2.Request('', headers={ 'User-Agent': 'Mozilla/5.0' }) html = urllib2.urlopen(req).read() print len(html) That's the smallest example I can make. If you run that then ~1 in 5 times the length of the response will be 5769, and the other times it will be a normal usable response. Whats...

MediaWiki 1.25 - show content for logged out users only

In my MediaWiki skin (Vector) I want to only show some content for logged out users. In the past I would do this with something like: <?php if( $wgUser->isAnon() ) { ?> <p>My content</p> <?php } ?> However, it appears that in MediaWiki 1.25 the $wgUser global has been deprecated....

how to use Piwik device detector in php project?

i want to use php device detector that is part of famous Piwik project, but i can't understand how to include and use the code in my php code? i don't want to use composer. i wrote: <?php include 'DeviceDetector.php'; use DeviceDetector\DeviceDetector; use DeviceDetector\Parser\Device\DeviceParserAbstract; $dd = new DeviceDetector($_SERVER['HTTP_USER_AGENT']); $dd->parse(); $clientInfo...

Can $_SERVER['HTTP_USER_AGENT'] contain '+' symbol?

I was wondering if $_SERVER['HTTP_USER_AGENT'] can output user agents with a + instead of a space. I'm seeing a lot of votes being made in the voting system of my website, using a plus in the user agent, such as: Mozilla/5.0+(Windows+NT+6.2;+WOW64;+rv:33.0)+Gecko/20100101+Firefox/33.0 Mozilla/5.0+(Windows+NT+5.1;+U;+en)+Presto/2.10+Version/11.60 I suspect that this is some sort of...

Wikipedia API - How to get all links from multiple pages?

I'm new to wiki api. I have read how to get all links from a specific page, and managed to do so, but in my case I need a list of links from many pages. And sending a request for each page is inefficient. This is the kind of request...

wikipedia edit - how to “go to” the content of a subtitle?

In my wikipedia page, I have a subtitle called subtitleA. Before arriving at this point when reading, I have one sentence that has a link that jumps to the content of that subtitle. To be more clear, this is a simple illustration: To do this, you will need `this` (link...

Nesting templates as part of a table is mysteriously eating a word in MediaWiki

When I use templates as individual lines in a table, it mostly seems to work perfectly, except for one spot where it keeps eating the first word of the second column, and I don't know why. Background: I have a small MediaWiki, just large enough to need several navigation lists,...

Perform a search using JSoup

Since the Soundcloud Java API is discontinued, I want to perform a search on their site using JSoup. I am currently using this code: Document doc = Jsoup .connect("") .userAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36") .timeout(5000).get(); But the webpage is giving me a message that I...

Restore MediaWiki site from physical files (MySQL)

One of our servers crashed last week and it wouldn't boot. So I got a full copy of the whole file system, and restored a previous backup. Now it is up and running, but there is a problem: the most recent changes made to a MediaWiki site were lost (the...

How to login using mediawiki's api, curl, and bash?

My understanding of the process: From mediawikis login manual When using MediaWiki's web service API, you will probably need your application or client to log in. This involves submitting a login query, constructing a cookie, and confirming the login by resubmitting the login request with the confirmation token returned....

Change user agent for selenium driver

I have the following code in Python: from selenium.webdriver import Firefox from contextlib import closing with closing(Firefox()) as browser: browser.get(url) I would like to print the user-agent HTTP header and possibly change it. Is it possible?...

Displaying edit count on MediaWiki

I would like to display number of edits / contribution on user page. Is there any way to do that? I tried to use link mentioned here: So if follow that, I got a URL something like this: http://ourdomain/api.php?action=query&list=users&ususers=MYUSERNAME&usprop=editcount And if I use it, it shows me a page...