0x0
     ˆÈÇÆ490ÅÄÃ ê    ‹      Å”[�Ó0…ß÷W~à-™ÞV‚]'¨$TêMmB!×v'Žlï–å×ã6­¶ ­¸<ÀS<É—™sNbÓgù<[XŒàíz:�Å»×“q$B|ßÏóuÞ>Ä�.âhF€”Þ77ˆ»Ý.Þõcc·¸^bé+=@ç­â>^�ôŠîï¥W@KÉD¸õÊk™Žk!¿‚) Í�wJÈÞi�ÂT�¬E¡´Œ…¬L\º˜Ó„Âp9§Oô k8úÒ†þ‘“º@kŒÇ;gÑ•ÌJÔ†3-QÝQlG1xTC7F<ìEvÿ� 0÷	Ûtí—6¥¾„{¦Õ¶Nˆ7I©ª¶à,O*nj‡Íê/ñV˜ö	ù8ÎæŸ¦îßN)ƒ0¾HÈ«,™ÝÎ“œ¤3VIŠìif˜!I'Ìy¨ŒP…’â"¼já•úv¹aÞ2¹tÜªÆ+S?¢,ž[åF»†¯×ÁAiÏ©¿JƒñÂX—£Ù:/ÛHÄ¾Å£ºõyIºUí!WVroìÃ1‚VÏózãšÛS	GƒVmKOR€ž$ÿ •Âh!íy.—™dŸ§£Õjøf´
ªÏ«sÅ?Iìuzý¨ó2ê½€îõM§ðW^~ó?Àã¡xØ°ÛSå;Eçñ\¸    5   ˆl–Ãa¾”Ò~êq@³q°Üeõ1hß�þZh«8à#mèÂÔ` ?ŸÂƒ@/ÇÅÄ N    The Debian stable security team does not provide security support for
certain configurations known to be inherently insecure. This includes
the interpreter itself, extensions, and user scripts written in the PHP
language. Most specifically, but not exclusively, the security team will
not provide support for the following.

 * Security issues which are caused by careless programming, such as:
   - extracting a tar file without first checking the contents;
   - using unserialize() on untrusted data;
   - relying on a specific value of short_open_tag.

 * Vulnerabilities involving any kind of open_basedir violation, as
   this feature is not considered a security model either by us or by
   PHP upstream.

 * Any "works as expected" vulnerabilities, such as "user can cause
   PHP to crash by writing a malicious PHP script", unless such
   vulnerabilities involve some kind of higher-level DoS or privilege
   escalation that would not otherwise be available.

PHP upstream has published a statement regarding their view on security
and the PHP interpreter:
http://www.php.net/security-note.php
     ˆÉÈÇ599ÆÅÄ W    ‹      Õ–QoÚ0Çßû)<?ì�Pè™:‚44
ˆ2MÓ4!b‘Ø‘}iÆ>ý‚v uëÆSÎ—ìÿïl9ç¿	Ç½Ù—IŸ|˜ÝÉäÓûá Ghàóu œ…Õ‹–Wo ôG”Ð1ë Eá×ž6+˜M!Æ4i�E##ô8r\ùe.¸"~,wOâ£ÄDÅÅw¢—tŽVrÑÜÀujÁ
Å—2©öbëEZgn®#[³6Ù«Ýr\<B3­N»6_¸$Š7ídºÆ‡jagv^ü…æ›Òbã_Øq«nËÁ[WehcòÈ¹R]Š:£�/Ó±&êR�‘V	Sko%—”°»ôë 7þæt€qùuà3±ìÒw½îèvÜi0b©ð��ÖÜ;Í†Ì"I5—K)øYñC%~�?ÎOVšPØÈÈ¥V)8ÄcÔH'6cŽµíbs¬ª$üwÕ`Ñ“bLî¦ýÑ,L«’ðrŠƒ»WØ\L˜
I(�ˆP›ÍŽ¾²òV-lv»’›‘«i@H�œTþAArµVºPÇ5qõ>Yf7*¢Áöqlò™«f½ySk4kõ&i´:õBÎÝíðñ5íç¨mn3·ys.¶™§ÖÑœÈ^ œÓ£Ñ	vÁ"˜\¡LÅœE(Å|-¹ÛžÉ—£5þS´2þ­Œ/M¨ò¿ÄX»ÄD‹ó£3X�/¨ºçvŸæ/0·luÄµþ}œö'°ëÜ|Ø¶‘>T�îO7Ha˜L    D   ˆl–Ü4ý('ÜZÔâ€vàZ¸ÓJbÑ¿�þ^yåœl�Èû�ºž'óÃƒ^kÈ_�uÐb&=LyZËcõÇÆ ˆ    # Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/

module EnsuresNoRelatedObjects
  extend ActiveSupport::Concern

  included do
    before_destroy :ensures_no_related_objects
  end

  class_methods do
    def ensures_no_related_objects_classes
      # this cache doesn't need to be cleared as the result won't change
      @ensures_no_related_objects_classes ||= Models
                              .all
                              .keys
                              .select { |klass| klass.column_names.include? 'perform' }
    end

    def ensures_no_related_objects_path(*path)
      @path = path if path.present?

      @path
    end
  end

  def ensures_no_related_objects
    validator = EnsuresNoRelatedObjects.new(self)
    return if !validator.references?

    raise Exceptions::UnprocessableContent
      .new __('This object is referenced by other object(s) and thus cannot be deleted: %s'), [validator.references_text]
  end

  class EnsuresNoRelatedObjects
    attr_reader :record

    def initialize(record)
      @record = record
    end

    def references?
      references.any?
    end

    def references
      @references ||= record.class.ensures_no_related_objects_classes.each_with_object({}) do |model, result|
        performables = referencing_objects(model)
        next if performables.blank?

        result[model.name] = performables
      end
    end

    def referencing_objects(model)
      model.find_each.with_object([]) do |performable, result|
        next if !referenced_in?(performable)

        result.push(performable.slice(:id, :name))
      end
    end

    def referenced_in?(performable)
      # The configu