עריכת הדף "
תבנית:Pagelang/תיעוד
" (פסקה)
קפיצה לניווט
קפיצה לחיפוש
אזהרה:
אינכם מחוברים לחשבון. כתובת ה־IP שלכם תוצג בפומבי אם תבצעו עריכות כלשהן. אם
תיכנסו לחשבון
או
תיצרו חשבון
, העריכות שלכם תיוחסנה לשם המשתמש שלכם ותקבלו גם יתרונות אחרים.
בדיקת אנטי־ספאם.
אין
למלא שדה זה!
== Technical note == When a subpage page contains any (single or double) quotes or ampersands, it is not a valid language code; PAGENAME and SUBPAGENAME normally HTML-encodes these characters in their return value, so they are safe to use as input of #language. But #titleparts restores these quotes or ampersands by HTML-decoding them. But then #language will produce a fatal server error when it is used with "language codes" with single quotes ; Proof This still works: <source lang="html5"> {{#language: fr|{{#titleparts:There's a fatal bug in MediaWiki|1}}}} </source> This does not work either: <source lang="html5"> {{#language: fr|{{PAGENAME:There's a fatal bug in MediaWiki}}}} </source> Nor does this: <source lang="html5"> {{#language: fr|There's a fatal bug in MediaWiki}} </source> <span class="error">This is a critical bug of the #language parser function, and apparently a severe security issues that could be caused by some clever insertion of code in PHP after the quote.</span> This bug only occurs in the second parameter of #language (the target language into which to give the name of the language specified by the code in the first parameter). Only the first parameter is checked for validity, but not the second one. Here, where #language cannot find the name of the language, in any target language, it should return the native language name, as in: <source lang="html5"> {{#language: fr|invalid language}} </source> : {{#language: fr|invalid language}} ; Word-around used in this template To avoid this severe bug, we want to detect these ''damned'' quotes (or ampersands) in subpage names, as they are invalid anyway in any language code, in order to return an empty string and not the subpage name: such subpage name cannot be a language code anyway. One way to detect subpages that cannot be safe language codes is to check if their value filtered by #titleparts is equal to their value filtered by PAGENAME: if they aren't equal that's because they contained ampersands, or quotes. ; Why we use titleparts and not just SUBPAGENAME ? Titleparts is used in this template instead of using SUBPAGENAME, but using SUBPAGENAME would not avoid the bug either, because it could as well return the full page name containing the damned quotes ! (SUBPAGENAME only works in namespaces where subpages have been activated (so it does not work in the main namespace to see if it has been translated using a language code suffix).
תקציר:
שימו לב:
תרומתכם לאוצר הספרים היהודי השיתופי תפורסם תחת תנאי הרישיון: ללא שימוש ציבורי וללא שימוש מסחרי (למעט בידי אוצר הספרים היהודי השיתופי, ראו
אוצר:זכויות יוצרים
לפרטים נוספים). אם אינכם רוצים שעבודתכם תהיה זמינה לעריכה על־ידי אחרים, שתופץ לעיני כול, ושאוצר הספרים היהודי השיתופי יוכל להשתמש בה ובנגזרותיה – אל תפרסמו אותה פה. כמו־כן, אתם מבטיחים לנו כי כתבתם את הטקסט הזה בעצמכם, או העתקתם אותו ממקור שאינו מוגן בזכויות יוצרים.
אל תעשו שימוש בחומר המוגן בזכויות יוצרים ללא רשות!
ביטול
עזרה בעריכה
(נפתח בחלון חדש)
תפריט ניווט
כלים אישיים
עברית
לא בחשבון
שיחה
תרומות
יצירת חשבון
כניסה לחשבון
מרחבי שם
תבנית
שיחה
עברית
צפיות
קריאה
עריכה
גרסאות קודמות
עוד
חיפוש
ניווט
עמוד ראשי
שינויים אחרונים
דף אקראי
עזרה
ייעוץ כללי
בקשת ספרים
עורכים שואלים
דיווח על טעויות
צ'אט להדרכת עריכה
יש לי חידוש!
עריכה תורנית
עריכה תורנית
עזר לעורך
פורום עורכים
בית המדרש
אחרונים בפורום
פעילות המיזם
פרויקטים פתוחים
לוח מודעות
אולם דיונים
בקשות מהמערכת
בקשות ממפעילים
כלים
דפים המקושרים לכאן
שינויים בדפים המקושרים
דפים מיוחדים
מידע על הדף